Ejemplo n.º 1
0
    def __init__(self, position, radius, serial=None, batch=None):
        super(Trigger, self).__init__("Trigger")
        self.position = position
        self.bounding_radius = radius
        self.state = self.READY
        self.uuid = uuid()
        if serial:
            self.position = serial.position
            self.bounding_radius = serial.bounding_radius
            self.uuid = serial.uuid

        self.batch = batch or pyglet.graphics.Batch()
        self.cvl = self.batch.add(1, pyglet.gl.GL_POINTS, None, ("v2f", (0, 0)), ("c3f", (0, 0, 0)))
        self.update_points()
Ejemplo n.º 2
0
    def __init__(self, position, radius, serial=None, batch=None):
        super(Trigger, self).__init__("Trigger")
        self.position = position
        self.bounding_radius = radius
        self.state = self.READY
        self.uuid = uuid()
        if serial:
            self.position = serial.position
            self.bounding_radius = serial.bounding_radius
            self.uuid = serial.uuid

        self.batch = batch or pyglet.graphics.Batch()
        self.cvl = self.batch.add(1, pyglet.gl.GL_POINTS, None,
                                  ('v2f', (0, 0)), ('c3f', (0, 0, 0)))
        self.update_points()
Ejemplo n.º 3
0
 def __init__(self, scene, batch=None, kind=0, serial=None):
     self.uuid = uuid()
     self.kind = kind
     self.scene = scene
     self.guides = []
     self.trigger_uuids = [] # needed to connect to correct trigger after serialization
     self.batch = batch or pyglet.graphics.Batch()
     self.pvl = self.batch.add(1, pyglet.gl.GL_LINE_STRIP, None,
                              ('v2f', (0, 0)),
                              ('c3f', (0, 0, 0)))
     self.gvl = self.batch.add(1, pyglet.gl.GL_POINTS, None,
                               ('v2f', (-100, -100)),
                               ('c3f', (0, 0, 0)))
     if serial:
         self.load_serial(serial)