Skip to main content

Interface: M2Image

An image that has been loaded into the game.

Remarks

An M2Image is a wrapper around a CanvasKit Image, with some additional properties.

Properties

canvaskitImage

canvaskitImage: undefined | Image

The image in CanvasKit format.

Defined in

M2Image.ts:12


fallbackLocalizationUrls?

optional fallbackLocalizationUrls: string[]

For a localized image that will be fetched, additional URLs to try if the URL in url fails.

Defined in

M2Image.ts:24


height

height: number

Defined in

M2Image.ts:14


imageName

imageName: string

Name of the image, as it will be referred to when creating a sprite.

Defined in

M2Image.ts:10


isFallback

isFallback: boolean

Is this image a fallback localized image?

Defined in

M2Image.ts:20


localize

localize: boolean

Try to localize the image by fetching a locale-specific image? Default is false.

Defined in

M2Image.ts:28


originalUrl?

optional originalUrl: string

For an image that will be fetched, the original URL before any localization.

Defined in

M2Image.ts:22


status

status: M2ImageStatus

Status of the image: Deferred, Loading, Ready, or Error.

Defined in

M2Image.ts:16


svgString?

optional svgString: string

An image defined by an SVG string.

Defined in

M2Image.ts:26


url?

optional url: string

For an image that will be fetched, this is the URL that will be attempted. This may have localization applied.

Defined in

M2Image.ts:18


width

width: number

Defined in

M2Image.ts:13