ActorBox - stingray.ActorBox object reference - Stingray Lua API Reference
A "box" that stores an Actor object across multiple frames, ensuring that the stored Actor has not become
invalid by being destroyed in the physics world.
When you need a reference to an actor to persist across multiple frames, you can call ActorBox.store() to store the actor in an ActorBox, and
ActorBox.unbox() to retrieve the stored values.
|
Stores the specified actor in the specified box.
|
Parameters Returns | This function does not return any values. |
If actor is nil, the box is cleared.
|
unbox ( self ) : nil, stingray.Actor
Retrieves the stored actor from the box, if any.
|
Parameters self : | stingray.ActorBox |
Specifies the object instance that this function will act on.
|
Returns stingray.Actor |
The actor last stored in the box, if it is still valid. If the box is empty, or if the actor last stored
in the box has been destroyed in the physics world, returns nil.
|