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.

Source

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.

Source

M2Image.ts:24


height

height: number

Source

M2Image.ts:14


imageName

imageName: string

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

Source

M2Image.ts:10


isFallback

isFallback: boolean

Is this image a fallback localized image?

Source

M2Image.ts:20


localize

localize: boolean

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

Source

M2Image.ts:28


originalUrl?

optional originalUrl: string

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

Source

M2Image.ts:22


status

status: M2ImageStatus

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

Source

M2Image.ts:16


svgString?

optional svgString: string

An image defined by an SVG string.

Source

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.

Source

M2Image.ts:18


width

width: number

Source

M2Image.ts:13