GameObject

Group
player
Extends
TileObject
Methods
10
Fields
None

Methods

MethodReturnsDescription
getConvexHull()Shape?The outline of its model on the canvas (the convex hull of its projected vertices, at its local position, model orientation and height; an…
getRenderable()Renderable?What the scene draws for it: a model, or an animated loc (getModel() reads it), nil when it is gone.
sizeX()numberIts width in tiles, as rotated.
sizeY()numberIts length in tiles, as rotated.
getSceneMinLocation()PointThe scene tile of its south-west corner.
getSceneMaxLocation()PointThe scene tile of its north-east corner.
getOrientation()numberIts orientation, 0..2047 (JAU): the loc's rotation times 512 plus its model's own orientation.
getModelOrientation()numberIts model's orientation in JAU: 256 for a diagonal (type 11) loc, else 0, as the scene builder places it.
getConfig()numbertype & 31, orientation >>> 6 & 3, supports items >>> 8 & 1.
getAnimationId()numberThe id of the animation the loc's dynamic renderable plays, -1 for a static loc, in one call. getRenderable():getAnimation():getId() read…

Returned by

MethodReturnsDescription
GameObjectDespawned.getGameObjectGameObjectThe object.
GameObjectSpawned.getGameObjectGameObjectThe object.
Tile.getGameObjects{ n: number, [number]: GameObject? }The loc game objects on it, every one covering it, padded with nil to five slots.

Method details

getConvexHull

getConvexHull: (GameObject) -> Shape?

The outline of its model on the canvas (the convex hull of its projected vertices, at its local position, model orientation and height; an animated loc's model as it poses it for the current cycle), nil when it does not project, its model is not readable (an animated loc, or any loc in HD, where the table has that model's read off) or it is gone.

getOrientation

getOrientation: (GameObject) -> number

Its orientation, 0..2047 (JAU): the loc's rotation times 512 plus its model's own orientation.

getModelOrientation

getModelOrientation: (GameObject) -> number

Its model's orientation in JAU: 256 for a diagonal (type 11) loc, else 0, as the scene builder places it.

getConfig

getConfig: (GameObject) -> number

type & 31, orientation >>> 6 & 3, supports items >>> 8 & 1.

getAnimationId

getAnimationId: (GameObject) -> number

The id of the animation the loc's dynamic renderable plays, -1 for a static loc, in one call. getRenderable():getAnimation():getId() reads the same id through two handles (a DynamicObject, then an Animation, nil while it plays none). A static loc's renderable is a plain Renderable with no getAnimation, so that chain raises there: test typeof(r) == "DynamicObject" first.