used for state() and returnState(), builds states that are returnable. Stacking two states is destructive.
List of objects that block this object
List of objects that this object blocks
reference to the physics body (matter.js). Empty if physics is not enabled
how the object is bounded in the scene (set with scene.setBoundaries())
are the bounds active on this object?
The color of the text, in hex or rgb format
true if the object is convex, false otherwise
The coordinates of the text
The font of the text, eg: "Arial", "Times New Roman", etc.
The font size of the text, in pixels
Game object options of the game object (for serialization and recreation)
Hitbox of the object, if the object is a square
unique ID for each object
True if the object is the local player, false otherwise
Meta data of the object
boolean if physics is enabled on the object
options for the physics engine
Reference point to pin the object to (only applies if the object is pinned)
does nothing!
points of the object (used for collision detection)
True if the object is a square, false otherwise
The text to render
The type of the object, "text"
Applies a force to the object (only works if physics enabled)
The force vector to apply to the object
Checks for a collision with another object
The object to check for a collision with
Boolean, true of the object is colliding with the other object, false otherwise
Checks for a collision with a polygon
The polygon (lower case, not type Polygon) to check for a collision with
Boolean, true of the object is colliding with the other object, false otherwise
Draws the text onto the provided drawing context. This is handled automatically with scene and scene managers
DrawOptions for the object
Draws the object's label on top of the object The label is the objects meta label (eg: object.meta.label = "...")
The DrawOptions for the object
Gets the height, as rendered, of the text
The scene that the text is in
The height of the text, in pixels
Gets the width, as rendered, of the text
The scene that the text is in
The width of the text, in pixels
Top level move function (works with both physics enabled and disabled)... needs helper functions getWidth(), getHeight() to be defined. Recommended to re-write based on your use case (if extending)
Vector to move the object by
If set to false, the object will not move if physics are not enabled. If true, the object will move if physics are not enabled. True by defualt
Boolean, true if the move was successful, false if it was not (if it was out of bounds, it will not move)
Moves an object that has physics enabled by a vector (no forces pr boundaries involved)
The vector to move the object by
Whether the object was moved or not (if it was out of bounds, it will not move)
Modifies pin to a game object
The game object to pin to
The reference point to pin to (either "center" or "coordinates")
Returns the object as a JSON object
The object as a JSON object
Static
FromGenerated using TypeDoc
Classdesc
Text class, used for rendering text
Example