Beispiel #1
0
 def __init__(self,parent,x,y,w,h,col=(1,1,1)):
     """
     Constructor for Square
     @param parent: parent graphobject.
     @param x: x position relative to parent
     @param y: y position relative to parent
     @param w: width of the square
     @param h: height of the square
     @param col: color for the square
     """
     GraphObject.__init__(self,parent,x,y)
     RectCollider.__init__(self,w,h)
     self.col = col
Beispiel #2
0
 def __init__(self,parent,x,y,r,col=(0.1,0.1,0.1)):
     """
     Circle constructor.
     @param parent: parent graphobject.
     @param x: x position relative to parent
     @param y: y position relative to parent
     @param r: radius for the circle
     @param col: color for the circle
     """
     GraphObject.__init__(self,parent,x,y)
     CircleCollider.__init__(self,r)
     self.col = col
     self.r0=r
     self.r=2+self.r0
Beispiel #3
0
 def __init__(self,parent,x,y,w,h,col=(1.0,1.0,1.0),name=""):
     """
     Constructor for Label
     @param parent: parent graphobject.
     @param x: x position relative to parent
     @param y: y position relative to parent
     @param w: width of the label
     @param h: height of the label
     @param col: color for the label
     @param name: text for the label
     """
     GraphObject.__init__(self,parent,x,y)
     RectCollider.__init__(self,w,h)
     self.col = col
     self.name = name
     self.maxdist = 4
Beispiel #4
0
 def __init__(self,parent,x0,y0,x1,y1,color):
     GraphObject.__init__(self,parent,x0,y0)
     self.x1=x1
     self.y1=y1
     self.color=color
     self.maxdist = 3