Images > Show Images


Read our Image API guide for an explanation of these blocks.


Display Images

Create Instance of Image

instance of image

Creates an Image Instance from the given image. Usually assigned to an attribute right away.

new BitmapWrapper(new Bitmap([IMAGE]))

Attach Image Instance to Actor

attach image instance to actor at x int y int at front

Attaches the image instance to the specified actor at the given position.

attachImageToActor([IMAGE INSTANCE], [ACTOR], [INT], [INT], 1); // front
attachImageToActor([IMAGE INSTANCE], [ACTOR], [INT], [INT], 2); // behind

Attach Image Instance to Layer

attach image instance to layer id object at x int y int at front

Attaches the image instance to the specified layer (via ID or name) at the given position.

attachImageToLayer([IMAGE INSTANCE], cast engine.getLayerById([INT]), [INT], [INT], 1); //front
attachImageToLayer([IMAGE INSTANCE], cast engine.getLayerById([INT]), [INT], [INT], 2); //behind

Attach Image Instance to Screen

attach image instance to screen at x int y int

Attaches the image instance to the HUD layer at the given position. This will make it draw in front of everything and ignore the camera.

attachImageToHUD([IMAGE INSTANCE], [INT], [INT]);

Remove Image Instance from Parent (the thing it is attached to)

remove image instance from parent

Takes the image instance out of the game (by removing it from the object it is attached to).

removeImage([IMAGE INSTANCE]);

Z-Order

Set Z-Order for Image Instance

set z order for image instance to int

Sets the drawing order (within the layer/actor) for the image instance.

setOrderForImage([IMAGE INSTANCE], [INT]);

Send Image Instance to Different Layer

send image instance back a layer

Sets the drawing order (within the layer/actor) for the image instance in a user-friendly way.

bringImageBack([IMAGE INSTANCE]);
bringImageForward([IMAGE INSTANCE]);
bringImageToBack([IMAGE INSTANCE]);
bringImagetoFront([IMAGE INSTANCE]);

Z-Order for Image Instance

z order for image instance

Returns the drawing order (within the layer/actor) for the image instance.

getOrderForImage([IMAGE INSTANCE])

Properties

Set Position for Image Instance

set x to number for image instance

Sets the position of the image instance (relative to the actor/layer it is attached to).

setXForImage([IMAGE INSTANCE], [NUMBER]);
setYForImage([IMAGE INSTANCE], [NUMBER]);

Set Direction (Angle) for Image Instance

set direction to number degrees for image instance

Sets the direction (angle, in degrees) of the image instance (relative to the actor/layer it is attached to).

[IMAGE INSTANCE].rotation = [NUMBER];

Resize an Image Instance

set width to number % for image instance

Sets the width and height (in percentage) of the image instance. 100% keeps that dimension the same. 200% will double it. 50% will halve it.

[IMAGE INSTANCE].scaleX = ([NUMBER]/100);
[IMAGE INSTANCE].scaleY = ([NUMBER]/100);
[IMAGE INSTANCE].alpha = ([NUMBER]/100);

Set Origin Point for Image Instance

set origin to x number y number for image instance

Sets the origin (pivot) point for the image instance. This affects how it's scaled and rotated.

setOriginForImage([IMAGE INSTANCE], [NUMBER], [NUMBER]);

Get Position / Direction / Scale / Opacity for Image Instance

get x for image instance

Returns various properties for the image instance.

[IMAGE INSTANCE].x/Engine.SCALE
[IMAGE INSTANCE].y/Engine.SCALE
[IMAGE INSTANCE].rotation
[IMAGE INSTANCE].width/Engine.SCALE
[IMAGE INSTANCE].height/Engine.SCALE
[IMAGE INSTANCE].scaleX*100
[IMAGE INSTANCE].scaleY*100
[IMAGE INSTANCE].alpha

Tweening

Slide an Image Instance

slide image instance by x number y number over number sec using dropdown

Slides (moves) the image instance over the specified time.

moveImageBy([IMAGE INSTANCE], [NUMBER], [NUMBER], [NUMBER], [EASING]);
moveImageTo([IMAGE INSTANCE], [NUMBER], [NUMBER], [NUMBER], [EASING]);

Spin an Image Instance

spin image instance by number degrees over number sec using dropdown

Spins (rotates) the image instance over the specified time.

spinImageBy([IMAGE INSTANCE], [NUMBER], [NUMBER], [EASING]);
spinImageTo([IMAGE INSTANCE], [NUMBER], [NUMBER], [EASING]);

Fade In / Out an Image Instance

fade image instance to number % over number sec using dropdown

[Fades In / Fades Out] the image instance over the specified time.

fadeImageTo([IMAGE INSTANCE], [NUMBER] / 100, [NUMBER], [EASING]);

Grow / Shrink an Image Instance

grow image instance to w number % h number % over number sec using dropdown

Resizes the image instance in percentage terms over the specified time. 100% keeps that dimension the same. 200% will double it. 50% will halve it.

growImageTo([IMAGE INSTANCE], [NUMBER]/100, [NUMBER]/100, [NUMBER], [EASING]);

Transforms

Set Blend Mode for Image Instance

set blend mode for image instance to dropdown

Changes the blending mode for the image instance.

[IMAGE INSTANCE].blendMode = [BLEND MODE];

Apply Effect to Image Instance

apply effect filter to image instance

Applies the specified effect to the image instance. The effect persists until removed, so you do not need to call this each frame.

setFilterForImage([IMAGE INSTANCE], [EFFECT]);

Remove All Effects from Image Instance

remove all effects from image instance

Removes all effects from the image instance.

clearFiltersForImage([IMAGE INSTANCE]);