Class: Sprite

Sprite(bitmap)

new Sprite(bitmap)

The basic object that is rendered to the game screen.
Parameters:
Name Type Description
bitmap Bitmap The image for the sprite
Properties:
Name Type Description
voidFilter PIXI.filters.VoidFilter [static]
spriteId Number
opaque Boolean
bitmap Bitmap The image for the sprite.
width Number The width of the sprite without the scale.
height Number The height of the sprite without the scale.
opacity Number The opacity of the sprite (0 to 255).

Extends

  • PIXI.Sprite

Methods

(static) getBlendColor() → {Array}

Gets the blend color for the sprite.
Returns:
The blend color [r, g, b, a]
Type
Array

(static) getColorTone() → {Array}

Gets the color tone for the sprite.
Returns:
The color tone [r, g, b, gray]
Type
Array

(static) initialize(bitmap)

Parameters:
Name Type Description
bitmap Bitmap

(static) move(x, y)

Sets the x and y at once.
Parameters:
Name Type Description
x Number The x coordinate of the sprite
y Number The y coordinate of the sprite

(static) setBlendColor(color)

Sets the blend color for the sprite.
Parameters:
Name Type Description
color Array The blend color [r, g, b, a]

(static) setColorTone(tone)

Sets the color tone for the sprite.
Parameters:
Name Type Description
tone Array The color tone [r, g, b, gray]

(static) setFrame(x, y, width, height)

Sets the rectagle of the bitmap that the sprite displays.
Parameters:
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

(static) update()

Updates the sprite for each frame.