Skip to main content

Interface: BrowserImage

Image that can be rendered by a browser from a URL or from a HTML svg tag in string form. Provide either url or svgString, not both.

Properties

dataUrl?

optional dataUrl: string

Internal

Image asset as a Data URL. For m2c2kit library use only

Defined in

BrowserImage.ts:19


height

height: number

Height to scale image to

Defined in

BrowserImage.ts:12


imageName

imageName: string

Name that will be used to refer to the image. Must be unique among all images within a game

Defined in

BrowserImage.ts:8


lazy?

optional lazy: boolean

If true, the image will not be fully loaded until it is needed. Default is false. Lazy loading is useful for large "banks" of images. These should be lazy loaded because they may not be needed.

Defined in

BrowserImage.ts:23


localize?

optional localize: boolean

If true, try to use a localized version of the image. Localized images are loaded on demand and are not preloaded. Only an image whose asset is provided as a URL can be localized. Default is false.

Defined in

BrowserImage.ts:27


svgString?

optional svgString: string

The HTML SVG tag, in string form, that will be rendered and loaded. Must begin with <svg> and end with </svg>

Defined in

BrowserImage.ts:15


url?

optional url: string

URL of image asset (svg, png, jpg) to render and load

Defined in

BrowserImage.ts:17


width

width: number

Width to scale image to

Defined in

BrowserImage.ts:10