Exemplo n.º 1
0
 def randomNodes(self, flag=0) :
     for h in self.handles.values() : # prop list {}
         if not flag : 
             h.loc = utilities.randPoint(1, 1, self.width, self.height)
             h.updateVars()
         else :
             if h is not self.handles['grey'] :  ## no pitch change in this case
                 h.loc = utilities.randPoint(1, 1, self.width, self.height)
                 h.updateVars()
     h.updateDisplays() # last one does the job
Exemplo n.º 2
0
 def randomNodes(self, flag=0):
     for h in self.handles.values():  # prop list {}
         if not flag:
             h.loc = utilities.randPoint(1, 1, self.width, self.height)
             h.updateVars()
         else:
             if h is not self.handles[
                     'grey']:  ## no pitch change in this case
                 h.loc = utilities.randPoint(1, 1, self.width, self.height)
                 h.updateVars()
     h.updateDisplays()  # last one does the job
Exemplo n.º 3
0
    def start(self):
        """ First thing to happen after the instance has been initalisiated
            good place to instanciate classes and init stuff
        """

        for z in range(50):
            v = []
            x,y = utilities.randPoint(0, 0, self.width, self.height)
            for j in xrange(4):
                v.append( utilities.randPoint(x-100, y-100, x+100, y+100) )
            d = utilities.randint(10, 30)
##            bl = Marquee(x, y, z, d, d, color=(1,0,0,1), stroke=1)
            bl = Marquee(v, z, color=utilities.randRGB(), stroke=1)
            bl.interactiveState = 2 #draggable
Exemplo n.º 4
0
    def start(self):
        """ First thing to happen after the instance has been initalisiated
            good place to instanciate classes and init stuff
        """

        for z in range(50):
            v = []
            x, y = utilities.randPoint(0, 0, self.width, self.height)
            for j in xrange(4):
                v.append(
                    utilities.randPoint(x - 100, y - 100, x + 100, y + 100))
            d = utilities.randint(10, 30)
            ##            bl = Marquee(x, y, z, d, d, color=(1,0,0,1), stroke=1)
            bl = Marquee(v, z, color=utilities.randRGB(), stroke=1)
            bl.interactiveState = 2  #draggable
Exemplo n.º 5
0
 def start(self):
     """ First thing to happen after the instance has been initalisiated
         good place to instanciate classes and init stuff
     """
     for z in range(20):
         w,h = self.size
         x,y = utilities.randPoint(1,1,w,h)
         Shape(x, y, z, 50, (0.5, 0,8, 0.2, 0.7))
Exemplo n.º 6
0
 def start(self):
     """ do some dragggable circles
     """
     for z in range(100):
         x, y = utilities.randPoint(0, 0, self.size[0], self.size[1])
         w = utilities.randint(0, 100)
         c = Circle(x,y,z,w, color = utilities.randRGBA())
         c.interactiveState = 2 # draggable
Exemplo n.º 7
0
 def start(self):
     """ First thing to happen after the instance has been initalisiated
         good place to instanciate classes and init stuff
     """
     for i in range(100):
         x,y = utilities.randPoint(0, 0, self.width, self.height)
         d = utilities.randint(10, 30)
         bl = Blob(x, y, i+1, d, d, utilities.randRGBA())
         bl.interactiveState = 2 #draggable
Exemplo n.º 8
0
 def start(self):
     self.rect = 0,0, self.size[0], self.size[1]
     self.drunks = []
     for z in range(100):
         x,y = utilities.randPoint(rect=self.rect)#0,0, self.size[0], self.size[1])
         w = utilities.randint(20,40)
         c = utilities.randRGBA()
         s = utilities.choice((GLU_LINE, GLU_FILL, GLU_SILHOUETTE, GLU_POINT))
         self.drunks.append(Drunk(x,y,z,w, color=c, style=s))
Exemplo n.º 9
0
 def start(self):
     """ First thing to happen after the instance has been initalisiated
         good place to instanciate classes and init stuff
     """
     for i in range(100):
         x, y = utilities.randPoint(0, 0, self.width, self.height)
         d = utilities.randint(10, 30)
         bl = Blob(x, y, i + 1, d, d, utilities.randRGBA())
         bl.interactiveState = 2  #draggable
Exemplo n.º 10
0
 def start(self):
     """ First thing to happen after the instance has been initalisiated
         good place to instanciate classes and init stuff
     """
     self.trails = 1
     for z in range(50):
         x,y = utilities.randPoint(0,0,self.height, self.width)
         s = utilities.choice((GLU_LINE, GLU_FILL, GLU_SILHOUETTE, GLU_POINT))
         Expands(x,y,z, utilities.randint(1,300), utilities.randRGBA(),
                 utilities.randint(1,140), style = s).interactiveState = 2
Exemplo n.º 11
0
    def start(self):
        """ First thing to happen after the instance has been initalisiated
            good place to instanciate classes and init stuff
        """
        f = utilities.path("data/ixi2.png")

        for i in range(50):
            x, y = utilities.randPoint(0, 0, self.width, self.height)
            d = utilities.randint(30, 50)
            bl = ImageBlob(f, x, y, i, d, d)
            bl.interactiveState = 2  #draggable
Exemplo n.º 12
0
    def start(self):
        """ First thing to happen after the instance has been initalisiated
            good place to instanciate classes and init stuff
        """
        f = utilities.path("data/ixi2.png")

        for i in range(50):
            x,y = utilities.randPoint(0, 0, self.width, self.height)
            d = utilities.randint(30, 50)
            bl = ImageBlob(f, x, y, i, d, d)
            bl.interactiveState = 2 #draggable
Exemplo n.º 13
0
 def start(self):
     self.rect = 0, 0, self.size[0], self.size[1]
     self.drunks = []
     for z in range(100):
         x, y = utilities.randPoint(
             rect=self.rect)  #0,0, self.size[0], self.size[1])
         w = utilities.randint(20, 40)
         c = utilities.randRGBA()
         s = utilities.choice(
             (GLU_LINE, GLU_FILL, GLU_SILHOUETTE, GLU_POINT))
         self.drunks.append(Drunk(x, y, z, w, color=c, style=s))
Exemplo n.º 14
0
 def start(self):
     """ First thing to happen after the instance has been initalisiated
         good place to instanciate classes and init stuff
     """
     for i in range(6):
         w,h = self.size
         x,y = utilities.randPoint(1,1,w,h)
         r,g,b = utilities.randRGB()
         c = r,g,b,0.3
         s = utilities.choice((GLU_LINE, GLU_FILL, GLU_SILHOUETTE, GLU_POINT))
         Shape(x, y, i, 80, c, s)
Exemplo n.º 15
0
    def start(self) :
        self.nextstep = [0,0] # note is array and not tupple. Speed of each step
##        self.perching = 0
##        self.perch_timer = 0
        self.f1 = 0
        self.f2 = 0
        self.f3 = 0

        self.loc = utilities.randPoint(0, 0, self.app.width, self.app.height)
        self.color = utilities.randRGBA()
        self.width = utilities.randint(6,12)
        self.height = utilities.randint(6,12)
Exemplo n.º 16
0
 def start(self):
     """ First thing to happen after the instance has been initalisiated
         good place to instanciate classes and init stuff
     """
     for i in range(6):
         w, h = self.size
         x, y = utilities.randPoint(1, 1, w, h)
         r, g, b = utilities.randRGB()
         c = r, g, b, 0.3
         s = utilities.choice(
             (GLU_LINE, GLU_FILL, GLU_SILHOUETTE, GLU_POINT))
         Shape(x, y, i, 80, c, s)
Exemplo n.º 17
0
    def start(self):
        self.nextstep = [0,
                         0]  # note is array and not tupple. Speed of each step
        ##        self.perching = 0
        ##        self.perch_timer = 0
        self.f1 = 0
        self.f2 = 0
        self.f3 = 0

        self.loc = utilities.randPoint(0, 0, self.app.width, self.app.height)
        self.color = utilities.randRGBA()
        self.width = utilities.randint(6, 12)
        self.height = utilities.randint(6, 12)
Exemplo n.º 18
0
    def start(self):
        """ First thing to happen after the instance has been initalisiated
            good place to instanciate classes and init stuff
        """
        s = 'Size must fit your screen resolution under fullscreen mode, otherwise weird stuff happens'
        Text(s, 10, 100, 900, 'timesroman', 12)

        s = 'press scape to exit'
        Text(s, 10, 150, 900, 'timesroman', 12)

        for z in range(150):
            w,h = self.size
            x,y = utilities.randPoint(1,1,w,h)
            c = utilities.randRGBA()
            o = Rect(x,y,z, 40,40, c)
            o.interactiveState = 2 # this doesnt seem to affect the performance
Exemplo n.º 19
0
 def start(self):
     """ First thing to happen after the instance has been initalisiated
         good place to instanciate classes and init stuff
     """
     ##        self.trails = 1
     for z in range(50):
         x, y = utilities.randPoint(0, 0, self.height, self.width)
         s = utilities.choice(
             (GLU_LINE, GLU_FILL, GLU_SILHOUETTE, GLU_POINT))
         Expands(x,
                 y,
                 z,
                 utilities.randint(1, 300),
                 utilities.randRGBA(),
                 utilities.randint(1, 140),
                 style=s).interactiveState = 2
Exemplo n.º 20
0
 def start(self):
     """ First thing to happen after the instance has been initalisiated
         good place to instanciate classes and init stuff
     """
     self.trails = 1
     self.bgColor = 1, 1, 0, 0.06 # an alpha value causes fade out (better with values between 0.02 - 0.1)
     self.mouseVisible = 0 # hide mouse
     
     for z in range(100):
         w,h = self.size
         x,y = utilities.randPoint(0,0,w,h)
         d = utilities.randint(20, 50)
         rot = utilities.randint(1, 360)
         c = utilities.randRGBA()
         stroke = utilities.randint(0, (d/2)-5)
         deltax = deltay = 0
         while deltax==0 : deltax = utilities.randint(-20, 20)/10.0
         while deltay==0 : deltay = utilities.randint(-20, 20)/10.0
         b = BouncingBall(x, y, z, d, c, stroke, rot)#, style=GLU_POINT)
         b.delta = [deltax, deltay]
Exemplo n.º 21
0
    def randomSingleNode(self, node, mode=0) :
        if mode :
            # what about this ? http://code.activestate.com/recipes/576760-brownian-motion-of-stock/
            xrange1, xrange2 = int(self.handles[node].x) - 5, int(self.handles[node].x) + 5
            yrange1, yrange2  =  int(self.handles[node].y) - 5, int(self.handles[node].y )+ 5
        else :
            xrange1, xrange2 = 1, self.width
            yrange1, yrange2 =  1, self.height

        if xrange1 < 1 : xrange1 = 1
        if yrange1 < 1 : yrange1 = 1
        if xrange2 > self.width : xrange1 = self.width
        if yrange2 > self.height : yrange1 = self.height

##        print xrange1, yrange1, xrange2, yrange2
         
            
        self.handles[node].loc = utilities.randPoint(xrange1, yrange1, xrange2, yrange2)
        if node == 'grey': self.handles[node].x = self.width/2
        self.handles[node].updateVars()
        self.handles[node].updateDisplays()
Exemplo n.º 22
0
    def start(self):
        """ First thing to happen after the instance has been initalisiated
            good place to instanciate classes and init stuff
        """
        self.trails = 1
        self.bgColor = 1, 1, 0, 0.06  # an alpha value causes fade out (better with values between 0.02 - 0.1)
        self.mouseVisible = 0  # hide mouse

        for z in range(100):
            w, h = self.size
            x, y = utilities.randPoint(0, 0, w, h)
            d = utilities.randint(20, 50)
            rot = utilities.randint(1, 360)
            c = utilities.randRGBA()
            stroke = utilities.randint(0, (d / 2) - 5)
            deltax = deltay = 0
            while deltax == 0:
                deltax = utilities.randint(-20, 20) / 10.0
            while deltay == 0:
                deltay = utilities.randint(-20, 20) / 10.0
            b = BouncingBall(x, y, z, d, c, stroke, rot)  #, style=GLU_POINT)
            b.delta = [deltax, deltay]
Exemplo n.º 23
0
    def randomSingleNode(self, node, mode=0):
        if mode:
            # what about this ? http://code.activestate.com/recipes/576760-brownian-motion-of-stock/
            xrange1, xrange2 = int(self.handles[node].x) - 5, int(
                self.handles[node].x) + 5
            yrange1, yrange2 = int(self.handles[node].y) - 5, int(
                self.handles[node].y) + 5
        else:
            xrange1, xrange2 = 1, self.width
            yrange1, yrange2 = 1, self.height

        if xrange1 < 1: xrange1 = 1
        if yrange1 < 1: yrange1 = 1
        if xrange2 > self.width: xrange1 = self.width
        if yrange2 > self.height: yrange1 = self.height

        ##        print xrange1, yrange1, xrange2, yrange2

        self.handles[node].loc = utilities.randPoint(xrange1, yrange1, xrange2,
                                                     yrange2)
        if node == 'grey': self.handles[node].x = self.width / 2
        self.handles[node].updateVars()
        self.handles[node].updateDisplays()
Exemplo n.º 24
0
 def randomBoxes(self):
     for b in self.boxList:
         b.loc = utilities.randPoint(1, 1, self.width, self.height)
         b.updateLooper()
         b.moveLabel()
Exemplo n.º 25
0
 def randomBoxes(self) :
     for b in self.boxList :
         b.loc = utilities.randPoint(1, 1, self.width, self.height)
         b.updateLooper()
         b.moveLabel()