Logo Search packages:      
Sourcecode: python-gtkglext1 version File versions  Download package

def scribbling-worms::ScribblingWorm::__init__ (   self,
  scene,
  size,
  event,
  duration = 5,
  thickness = 4 
)
To create a ScribblingWorm you
have to provide a Scribble class instance,
current size of the drawable in a 2-tuple and
an Event class instance for signalling. Also the
duration of the worm's existance is optional.
It is specified in seconds. The thickness of each
scribble stroke can also be specified.

Definition at line 66 of file scribbling-worms.py.

                                                                    :
        ''' To create a ScribblingWorm you
        have to provide a Scribble class instance,
        current size of the drawable in a 2-tuple and
        an Event class instance for signalling. Also the
        duration of the worm's existance is optional.
        It is specified in seconds. The thickness of each
        scribble stroke can also be specified.
        '''
        Thread.__init__(self)

        # The thickness of each brush stroke.
        self.scribble_thick = thickness

        # continue_event is for signalling when to
        # exit this thread as requested by the
        # user.
        self.continue_event = event

        # glscene is the Scribble class implementing
        # the GLScene interface.
        self.glscene = scene

        # Current size of the drawable.
        width, height = size

        # These two coordinates are used for
        # drawing the scribbles via the Scribble class.
        self.x = randint(10,width-10)
        self.y = randint(10,height-10)

        # The loop iterations.
        self.sleep_time = 0.10
        self.iterations = int (duration / self.sleep_time)


Generated by  Doxygen 1.6.0   Back to index