@thejsngin/jsngin / Exports / GameObject
Interface: GameObject
Callable
GameObject
▸ GameObject(props
): Promise
<GameObjectInstance
>
This is the default export of a .jsnobj
file.
INFO
A gameObject can be instanciated as the root gameObject within a gameInstance
or as a child within another gameObjectInstance
. It is recommended to use gameInstance
or existing gameObjectInstace
to instanciate a gameObject
instead of directly creating a new gameObjectInstace
as this will not setup the required hooks.
Parameters
Name | Type |
---|---|
props | Object |
props.gameInstance | GameInstance |
props.name? | string |
props.parent? | GameObjectInstance |
props.userData? | any |
Returns
Promise
<GameObjectInstance
>
A new instance of this gameObject.