spriteRenderer.image = this.assetManager.getImage("image.png");
spriteRenderer.width = 1920;
spriteRenderer.height = 1080;
spriteRenderer.offset = new Vector2(0, 0);
spriteRenderer.flipHorizontally = false;
spriteRenderer.flipVertically = false;
spriteRenderer.rotation = 0;
spriteRenderer.opacity = 1;
spriteRenderer.maskColor = "#FF0000";
spriteRenderer.maskColorMix = 0;
spriteRenderer.tintColor = "#00FF00";
spriteRenderer.layer = "Default";
spriteRenderer.slice = {x: 0, y:0, width: 1920, height: 1080};
spriteRenderer.scale = new Vector2(1, 1);
spriteRenderer.tiled = new Vector2(1, 1);
spriteRenderer.smooth = false;

Constructors

Properties

flipHorizontally: boolean = false

Flip the image horizontally

flipVertically: boolean = false

Flip the image vertically

height: number

Overwrite the original image height

image: HTMLImageElement

The image to render

layer: string = defaultRenderLayer

The render layer

maskColor: string

Define a mask color for the image

maskColorMix: number

Define the opacity of the mask color between 1 and 0

offset: Vector2 = ...

X-axis and Y-axis offset

opacity: number = 1

Change the opacity between 1 and 0

rotation: number = 0

Image rotation in radians

scale: Vector2 = ...

Scale the image based on a vector

slice?: Slice

Cut the image based on straight coordinates starting from the top left downward

smooth: boolean = false

TRUE for smooth pixels (not recommended for pixel art)

tiled: Vector2

Enable tiled draw mode

tintColor: string

Define a color for tinting the sprite image

width: number

Overwrite the original image width