Пример #1
0
def getEventSignal(ename, val):
        if pythonfrp.Globals.eventSignals.has_key(ename):
            return Functions.tag(val, pythonfrp.Globals.eventSignals[ename])
        e = eventObserver(ename)
        pythonfrp.Globals.eventSignals[ename] = e
        PandaGlobals.direct.accept(ename, lambda: postEvent(ename))
        return Functions.tag(val, e)
Пример #2
0
 def __init__(self, object, position=None, hpr=None, size=1, color=None,
              texture=None, duration = 0, parent = render, name = "gemometry"):
     Proxy.Proxy.__init__(self, name="dynamicGeometry", updater=geometryUpdater,
                    types={"position": p3Type, "hpr": hprType, "size": numType,
                         "color": colorType, "texture": stringType, "sideTwo": stringType})
     self._pandaModel = object
     self._parent = PandaModel.getModel(parent)
     self._name = name + str(PandaGlobals.nextModelId)
     PandaGlobals.nextModelId = PandaGlobals.nextModelId + 1
     self._name = name + str()
     self._onScreen = False
     self._currentTexture = ""
     self._currentsideTwo = ""
     if position is not None:
         self.position = position
     else:
         self.position = P3(0, 0, 0)
     if hpr is not None:
         self.hpr = hpr
     else:
         self.hpr = SHPR(0, 0, 0)
     if size is not None:
         self.size = size
     else:
         self.size = 1
     if texture is not None:
         self.texture = texture
     else:
         self.texture = ""
     if color is not None:
         self.color = color
     else:
         self.color = noColor
     if duration != 0:
         Functions.react(self, Functions.delay(duration), Functions.exitScene)
Пример #3
0
def getEventSignal(ename, val):
    if pythonfrp.Globals.eventSignals.has_key(ename):
        return Functions.tag(val, pythonfrp.Globals.eventSignals[ename])
    e = eventObserver(ename)
    pythonfrp.Globals.eventSignals[ename] = e
    PandaGlobals.direct.accept(ename, lambda: postEvent(ename))
    return Functions.tag(val, e)