Link Search Menu Expand Document

Sprite.d overview


Table of contents


utils

Sprite (class)

The basic object that is rendered to the game screen.

Signature

export declare class Sprite<T> {
  constructor(bitmap?: Bitmap)
}

destroy (method)

Destroys the sprite.

Signature

destroy(_options?: PIXIDestroyOptions): void

update (method)

Updates the sprite for each frame.

Signature

update(): void

hide (method)

Makes the sprite “hidden”.

Signature

hide(): void

show (method)

Releases the “hidden” state of the sprite.

Signature

show(): void

updateVisibility (method)

Reflects the “hidden” state of the sprite to the visible state.

Signature

updateVisibility(): void

move (method)

Sets the x and y at once.

Signature

move(x: number, y: number): void

setFrame (method)

Sets the rectagle of the bitmap that the sprite displays.

Signature

setFrame(x: number, y: number, width: number, height: number): void

setHue (method)

Sets the hue rotation value.

Signature

setHue(hue: number): void

getBlendColor (method)

Gets the blend color for the sprite.

Signature

getBlendColor(): [number, number, number, number]

setBlendColor (method)

Sets the blend color for the sprite.

Signature

setBlendColor(color: Color): void

getColorTone (method)

Gets the color tone for the sprite.

Signature

getColorTone(): [number, number, number, number]

setColorTone (method)

Sets the color tone for the sprite.

Signature

setColorTone(tone: Color): void

_onBitmapChange (method)

Signature

_onBitmapChange(): void

_onBitmapLoad (method)

Signature

_onBitmapLoad(bitmapLoaded: Bitmap): void

_refresh (method)

Signature

_refresh(): void

_createColorFilter (method)

Signature

_createColorFilter(): void

_updateColorFilter (method)

Signature

_updateColorFilter(): void

_refreshFrame (property)

Signature

_refreshFrame: boolean

spriteId (property)

Signature

spriteId: number

_bitmap (property)

Signature

_bitmap: T

_frame (property)

Signature

_frame: Rectangle

_hue (property)

Signature

_hue: number

_blendColor (property)

Signature

_blendColor: Color

_colorTone (property)

Signature

_colorTone: Color

_colorFilter (property)

Signature

_colorFilter: ColorFilter | null

_blendMode (property)

Signature

_blendMode: any

_hidden (property)

Signature

_hidden: boolean