The object owning the behavior
This method is called each tick after events are done.
The instanceContainer owning the object
This method is called each tick before events are done.
The instanceContainer owning the object
This method is called when the owner of the behavior
is being removed from the scene and is about to be destroyed/reused later
or when the behavior is removed from an object (can happen in case of
hot-reloading only. Otherwise, behaviors are just de-activated,
not removed. See onDeActivate
).
A hook must typically be registered by a behavior that requires this one in its onCreate function. The hook must stay forever to avoid side effects like a hooks order change. To handle deactivated behavior, the hook can check that its behavior is activated before doing anything.
Called at each frame after events. Call doStepPostEvents.
Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.
The instanceContainer owning the object
Called at each frame before events. Call doStepPreEvents.
Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.
The instanceContainer owning the object
Called when the behavior must be updated using the specified behaviorData. This is the case during hot-reload, and is only called if the behavior was modified.
The previous data for the behavior.
The new data for the behavior.
true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).
gdjs.RuntimeBehavior#onObjectHotReloaded
Update the behavior properties using the provided data.
The new properties of the behavior.
Should return false
if the behavior does not need any lifecycle function to
be called.
Default, hidden, "capability" behaviors set it to false
.
This avoids useless calls to empty lifecycle functions, which would waste CPU
time (and have a sizeable impact for example when lots of static instances
are living in the scene).
Allows an object to move in 4 or 8 directions, with customizable speed, accelerations and rotation.