Class: Sprite

Sprite

new Sprite (bitmap)

The basic object that is rendered to the game screen.

Name Type Description
bitmap Bitmap

The image for the sprite.

Extends

  • PIXI.Sprite

Members

bitmap Bitmap

The image for the sprite.

blendMode number

The blend mode to be applied to the sprite.

height number

The height of the sprite without the scale.

opacity number

The opacity of the sprite (0 to 255).

width number

The width of the sprite without the scale.

Methods

destroy ()

Destroys the sprite.

getBlendColor ()array

Gets the blend color for the sprite.

Returns:
Type Description
array The blend color [r, g, b, a].

getColorTone ()array

Gets the color tone for the sprite.

Returns:
Type Description
array The color tone [r, g, b, gray].

hide ()

Makes the sprite "hidden".

move (x, y)

Sets the x and y at once.

Name Type Description
x number

The x coordinate of the sprite.

y number

The y coordinate of the sprite.

setBlendColor (color)

Sets the blend color for the sprite.

Name Type Description
color array

The blend color [r, g, b, a].

setColorTone (tone)

Sets the color tone for the sprite.

Name Type Description
tone array

The color tone [r, g, b, gray].

setFrame (x, y, width, height)

Sets the rectagle of the bitmap that the sprite displays.

Name Type Description
x number

The x coordinate of the frame.

y number

The y coordinate of the frame.

width number

The width of the frame.

height number

The height of the frame.

setHue (hue)

Sets the hue rotation value.

Name Type Description
hue number

The hue value (-360, 360).

show ()

Releases the "hidden" state of the sprite.

update ()

Updates the sprite for each frame.

updateVisibility ()

Reflects the "hidden" state of the sprite to the visible state.