Class: AnimatedSprite

AnimatedSprite


new AnimatedSprite()

Source:

Extends

Members


anchor :Point

The anchor sets the origin point of the texture.
The default is 0,0 this means the texture's origin is the top left
Setting the anchor to 0.5,0.5 means the texture's origin is centered
Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner

Type:
  • Point
Inherited From:
Source:

blendMode :number

The blend mode to be applied to the sprite. Apply a value of BLEND_MODES.NORMAL to reset the blend mode.

Type:
  • number
Inherited From:
Default Value:
  • BLEND_MODES.NORMAL
Source:
See:
  • BLEND_MODES

cachedTint :number

An internal cached value of the tint.

Type:
  • number
Inherited From:
Default Value:
  • 0xFFFFFF
Source:

height :number

The height of the sprite, setting this will actually modify the scale to achieve the value set

Type:
  • number
Inherited From:
Source:

shader :AbstractFilter|Shader

The shader that will be used to render the sprite. Set to null to remove a current shader.

Type:
Inherited From:
Source:

texture :Texture

The texture that the sprite is using

Type:
Inherited From:
Overrides:
Source:

tint :number

The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

Type:
  • number
Inherited From:
Default Value:
  • 0xFFFFFF
Source:

width :number

The width of the sprite, setting this will actually modify the scale to achieve the value set

Type:
  • number
Inherited From:
Source:

Methods


addAnim(name [, frames] [, props])

Add new animation.

Parameters:
Name Type Argument Description
name String

Name of the animation

frames Array <optional>

Frames list

props Object <optional>

Properties

Source:
Returns:

Self for chaining

Type
AnimatedSprite

containsPoint(point)

Tests if a point is inside this sprite

Parameters:
Name Type Description
point Point

the point to test

Inherited From:
Source:
Returns:

the result of the test

Type
boolean

destroy( [destroyTexture] [, destroyBaseTexture])

Destroys this sprite and optionally its texture

Parameters:
Name Type Argument Default Description
destroyTexture boolean <optional>
false

Should it destroy the current texture of the sprite as well

destroyBaseTexture boolean <optional>
false

Should it destroy the base texture of the sprite as well

Inherited From:
Source:

getBounds(matrix)

Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.

Parameters:
Name Type Description
matrix Matrix

the transformation matrix of the sprite

Inherited From:
Source:
Returns:

the framing rectangle

Type
Rectangle

getLocalBounds()

Gets the local bounds of the sprite object.

Inherited From:
Source:

gotoFrame(frame)

Jump to specific frame.

Parameters:
Name Type Description
frame Number
Source:
Returns:

Self for chaining

Type
AnimatedSprite

play(name [, frame])

Play animation.

Parameters:
Name Type Argument Description
name String

Name of animation

frame Number <optional>

Frame index

Source:
Returns:

Self for chaining

Type
AnimatedSprite

remove()

Remove from parent

Source:

stop( [frame])

Stop animation.

Parameters:
Name Type Argument Description
frame Number <optional>

Frame index

Source:
Returns:

Self for chaining

Type
AnimatedSprite

Class: AnimatedSprite

AnimatedSprite


new AnimatedSprite(textures)

Parameters:
Name Type Description
textures Array

Textures this animation made up of

Source:

Members


anchor :Point

The anchor sets the origin point of the texture.
The default is 0,0 this means the texture's origin is the top left
Setting the anchor to 0.5,0.5 means the texture's origin is centered
Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner

Type:
  • Point
Inherited From:
Source:

blendMode :number

The blend mode to be applied to the sprite. Apply a value of BLEND_MODES.NORMAL to reset the blend mode.

Type:
  • number
Inherited From:
Default Value:
  • BLEND_MODES.NORMAL
Source:
See:
  • BLEND_MODES

cachedTint :number

An internal cached value of the tint.

Type:
  • number
Inherited From:
Default Value:
  • 0xFFFFFF
Source:

height :number

The height of the sprite, setting this will actually modify the scale to achieve the value set

Type:
  • number
Inherited From:
Source:

shader :AbstractFilter|Shader

The shader that will be used to render the sprite. Set to null to remove a current shader.

Type:
Inherited From:
Source:

texture :Texture

The texture that the sprite is using

Type:
Inherited From:
Overrides:
Source:

tint :number

The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

Type:
  • number
Inherited From:
Default Value:
  • 0xFFFFFF
Source:

width :number

The width of the sprite, setting this will actually modify the scale to achieve the value set

Type:
  • number
Inherited From:
Source:

Methods


addAnim(name [, frames] [, props])

Add new animation.

Parameters:
Name Type Argument Description
name String

Name of the animation

frames Array <optional>

Frames list

props Object <optional>

Properties

Source:
Returns:

Self for chaining

Type
AnimatedSprite

containsPoint(point)

Tests if a point is inside this sprite

Parameters:
Name Type Description
point Point

the point to test

Inherited From:
Source:
Returns:

the result of the test

Type
boolean

destroy( [destroyTexture] [, destroyBaseTexture])

Destroys this sprite and optionally its texture

Parameters:
Name Type Argument Default Description
destroyTexture boolean <optional>
false

Should it destroy the current texture of the sprite as well

destroyBaseTexture boolean <optional>
false

Should it destroy the base texture of the sprite as well

Inherited From:
Source:

getBounds(matrix)

Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.

Parameters:
Name Type Description
matrix Matrix

the transformation matrix of the sprite

Inherited From:
Source:
Returns:

the framing rectangle

Type
Rectangle

getLocalBounds()

Gets the local bounds of the sprite object.

Inherited From:
Source:

gotoFrame(frame)

Jump to specific frame.

Parameters:
Name Type Description
frame Number
Source:
Returns:

Self for chaining

Type
AnimatedSprite

play(name [, frame])

Play animation.

Parameters:
Name Type Argument Description
name String

Name of animation

frame Number <optional>

Frame index

Source:
Returns:

Self for chaining

Type
AnimatedSprite

remove()

Remove from parent

Source:

stop( [frame])

Stop animation.

Parameters:
Name Type Argument Description
frame Number <optional>

Frame index

Source:
Returns:

Self for chaining

Type
AnimatedSprite