world.add_physics_callback
Add a callback which will be called before each physics step.Physics is done regularly on a fixed time basis.
def callback_physics(step_size):
print("physics callback -> step_size:", step_size)
world.add_physics_callback("callback_physics", callback_physics)
world.add_render_callback
Add a callback which will be called after each rendering event such as.render().
def callback_render(event):
print("render callback -> event:", event)
world.add_render_callback("callback_render", callback_render)
world.add_stage_callback
Add a callback which will be called after each stage event such as open/close among others
def callback_stage(event):
print("stage callback -> event:", event)
world.add_stage_callback("callback_stage", callback_stage)
world.add_timeline_callback
Add a callback which will be called after each timeline event such as play/pause
def callback_timeline(event):
print("timeline callback -> event:", event)
world.add_timeline_callback("callback_timeline", callback_timeline)