Documentation Index
Fetch the complete documentation index at: https://mintlify.com/OmarMtya/enginejs-module/llms.txt
Use this file to discover all available pages before exploring further.
Imagen wraps an HTMLImageElement and attaches it to a Transform so that a Figura of tipo: 'imagen' can be drawn on the canvas. When a Sprite configuration is also provided, the engine switches from a plain drawImage call to DibujarSprite, which slices the sheet into individual frames and advances them over time.
Constructor
new Imagen(src, sprite = null)
The image to render. Must be a valid
Image object with its .src property
already set. The engine passes this reference directly to drawImage (or to
DibujarSprite as the sheet source), so the image should be fully loaded
before the first frame is drawn.Sprite sheet configuration. When set, the engine uses
DibujarSprite to
render a single frame from the sheet each tick and advances the frame index
according to the elapsed time. When null, the entire image is drawn at the
figure’s position and size. See Sprite.Instance Properties
The image reference passed at construction time.
Usage
Imagen is created, pass it to a Transform: