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 SpriteLocation.decorate from will show the Sprite. This SpriteLocation remains active until SpriteLocation.deactivate is called.

activate(sprite: Sprite, viewport: ScreenViewport, locationWorld: XYAndZ, 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 XYAndZ The position, in world coordinates
alpha number Optional alpha for the Sprite. Must be a number between 0 (fully transparent) and 1 (fully opaque).

Defined in

Last Updated: 08 January, 2020