activate Method

Activate this SpriteLocation to show a Sprite at a location in a single ScreenViewport. This call does not display the Sprite. Rather, subsequent calls to decorate from will show the Sprite. This SpriteLocation remains active until deactivate is called.

activate(sprite: Sprite, viewport: ScreenViewport, locationWorld: Readonly<WritableXYAndZ>, alpha?: number): void

Parameter Type Description
sprite Sprite The Sprite to draw at this SpriteLocation
viewport ScreenViewport The Viewport onto which the Sprite is drawn
locationWorld Readonly<WritableXYAndZ> The position, in world coordinates
alpha number Optional alpha for the Sprite. Must be a number between 0 (fully transparent) and 1 (fully opaque).

Returns - void

Defined in

Last Updated: 14 November, 2024