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?

Internal

optional dataUrl: string

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

Source

BrowserImage.ts:19


height

height: number

Height to scale image to

Source

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

Source

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.

Source

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.

Source

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>

Source

BrowserImage.ts:15


url?

optional url: string

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

Source

BrowserImage.ts:17


width

width: number

Width to scale image to

Source

BrowserImage.ts:10