Documentation Index
Fetch the complete documentation index at: https://mintlify.com/OmarMtya/engine.js/llms.txt
Use this file to discover all available pages before exploring further.
$g.Figura is the building block of every Engine.js scene. Every shape you see on the canvas — a square, a circle, or an image — is a Figura instance stored in the $g.figuras array. A Figura does not draw itself; it is a data container. The engine reads its tipo, transform, and rigido properties on every frame to decide what to render and how physics should behave.
Constructor
The shape type for this object. Accepted values are:
'cuadrado'— an axis-aligned rectangle'circulo'— a circle'imagen'— a rectangle rendered with a texture fromtransform.imagen
A
$g.Transform instance that defines the figure’s position, size, and color. Every Figura must have a transform — the engine will not render an object without one.Instance Properties
A unique integer identifier assigned automatically when the figure is created. Used internally by the editor to find and manage objects, and by the
$g.figuras array operations.A human-readable display name for the object. Defaults to an empty string. Set this to identify the figure in the hierarchy panel or in your own game logic.
The shape type —
'cuadrado', 'circulo', or 'imagen'. Can be changed at runtime; the engine will switch rendering mode on the next draw call.The attached
$g.Transform instance. Modify transform.x, transform.y, and other properties directly to move or resize the figure.An optional
$g.Rigido instance. When set, the animation loop applies gravity and collision detection to this figure. Set to null to remove physics entirely.