(→cscallback) |
|||
| Line 109: | Line 109: | ||
=== celcallback === | === celcallback === | ||
| - | + | {| border="1" cellpadding="5" cellspacing="0" | |
| - | iQuestTriggerCallback | + | |iQuestTriggerCallback||[http://www.crystalspace3d.org/cel/docs/online/api/structiQuestTriggerCallback.html api] |
| - | iQuestSequenceCallback | + | |- |
| - | iCelNewEntityCallback | + | |iQuestSequenceCallback||[http://www.crystalspace3d.org/cel/docs/online/api/structiQuestSequenceCallback.html api] |
| - | iCelEntityRemoveCallback | + | |- |
| - | iCelTimerListener | + | |iCelNewEntityCallback||[http://www.crystalspace3d.org/cel/docs/online/api/structiCelNewEntityCallback.html api] |
| - | iPcInventoryListener | + | |- |
| - | iPcTriggerListener | + | |iCelEntityRemoveCallback||[http://www.crystalspace3d.org/cel/docs/online/api/structiCelEntityRemoveCallback.html api] |
| - | iPcSoundListener | + | |- |
| - | iPcPropertyListener | + | |iCelTimerListener||[http://www.crystalspace3d.org/cel/docs/online/api/structiCelTimerListener.html api] |
| - | iPcMeshSelectListener | + | |- |
| - | + | |iPcInventoryListener||[http://www.crystalspace3d.org/cel/docs/online/api/structiPcInventoryListener.html api] | |
| - | + | |- | |
| + | |iPcTriggerListener||[http://www.crystalspace3d.org/cel/docs/online/api/structiPcTriggerListener.html api] | ||
| + | |- | ||
| + | |iPcSoundListener||[http://www.crystalspace3d.org/cel/docs/online/api/structiPcSoundListener.html api] | ||
| + | |- | ||
| + | |iPcPropertyListener||[http://www.crystalspace3d.org/cel/docs/online/api/structiPcPropertyListener.html api] | ||
| + | |- | ||
| + | |iPcMeshSelectListener||[http://www.crystalspace3d.org/cel/docs/online/api/structiPcMeshSelectListener.html api] | ||
| + | |- | ||
| + | |iPcGravityCallback||[http://www.crystalspace3d.org/cel/docs/online/api/structiPcGravityCallback.html api] | ||
| + | |- | ||
| + | |} | ||
Back to [[PyCrystal]] | Back to [[PyCrystal]] | ||
Revision as of 19:40, 4 January 2008
Contents |
Introduction
There are a number of interfaces in cs and cel which can serve as callbacks to discover things happening in engine. To be able use this functionality, one must inherit from special base classes for python.
There are two modules in csexternal repository that provide such classes, one for cs and one for cel: cscallback and celcallback.
In general for a given interface, there is a base class, with the naming convention of prefixing with py instead of i as is normal for interfaces.
Example
For example, in iMovableListener this would be pyMovableListener. And to use it just declare your class inheriting from this, and implement the needed functions in interface from python:
from cscallback import pyMovableListener
class MyMovableListener(pyMovableListener):
# constructor
def __init__(self):
pyMovableListener.__init__(self,ObjectRegistry)
# callback functions
def MovableChanged(movable):
print "movable changed"
def MovableDestroyed(movable):
print "movable destroyed"
movlistener = MyMovableListener()
Movable.AddListener(movlistener)
Note how the constructor for all callback classes requires that you pass the object registry (in the previous example, it is assumed ObjectRegistry is the object registry, and Movable a valid movable).
Supported interfaces
cscallback
| iMissingLoaderData | api |
| iTerrainCellHeightDataCallback | api |
| iTerrainCellLoadCallback | api |
| iParticleEmitter | api |
| iParticleEffector | api |
| iSkeletonBoneUpdateCallback | api |
| iSkeletonAnimationCallback | api |
| iSkeletonUpdateCallback | api |
| iMeshObjectDrawCallback | api |
| iObjectModelListener | api |
| iObjectNameChangeListener | api |
| iProcTexCallback | api |
| iODEFrameUpdateCallback | api |
| iReporterListener | api |
| iStandardReporterListener | api |
| iDynamicsStepCallback | api |
| iDynamicsMoveCallback | api |
| iDynamicsCollisionCallback | api |
| iDynamicsColliderCollisionCallback | api |
| iOffscreenCanvasCallback | api |
| iVisibilityCullerListener | api |
| iLightCallback | api |
| iPortalCallback | api |
| iCameraSectorListener | api |
| iEngineFrameCallback | api |
| iEngineSectorCallback | api |
| iSectorCallback | api |
| iSectorMeshCallback | api |
| iLightVisibleCallback | api |
| iMeshDrawCallback | api |
| iTextureCallback | api |
| iMovableListener | api |
| iSndSysStreamCallback | api |
| iSndSysRendererCallback | api |
| iSndSysListener | api |
| iSndSysListenerDoppler | api |
celcallback
| iQuestTriggerCallback | api |
| iQuestSequenceCallback | api |
| iCelNewEntityCallback | api |
| iCelEntityRemoveCallback | api |
| iCelTimerListener | api |
| iPcInventoryListener | api |
| iPcTriggerListener | api |
| iPcSoundListener | api |
| iPcPropertyListener | api |
| iPcMeshSelectListener | api |
| iPcGravityCallback | api |
Back to PyCrystal
