API Documentation for: 1.0.1
Show:

platypus.PIXIAnimation Class

Extends PIXI.Sprite
Module: platypus

This class plays animation sequences of frames and mimics the syntax required for creating CreateJS Sprites, allowing CreateJS Sprite Sheet definitions to be used with pixiJS.

Methods

setFrame

(
  • frameIndex
)

Defined in setFrame:406

Available since 0.11.1

Sets the texture and anchor for a particular frame.

Parameters:

  • frameIndex Number

    Animation frame index to set.

()

Defined in :208

The speed that the PIXIAnimation will play at. Higher is faster, lower is slower

()

Defined in :234

Indicates if the PIXIAnimation is currently playing

()

Defined in :281

The PIXIAnimations current frame index

gotoAndPlay

(
  • animation
  • [restart = true]
)

Defined in gotoAndPlay:384

Goes to a specific frame and begins playing the PIXIAnimation

Parameters:

  • animation String

    The animation to begin playing.

  • [restart = true] Boolean optional

    Whether to restart the animation if it's currently playing.

() private

Defined in :226

Elapsed time since animation has been started, used internally to display current texture

has

(
  • animation
)

Defined in has:424

Available since 0.9.0

Returns whether a particular animation is available.

Parameters:

  • animation String

    The animation to check.

destroy

()

Defined in destroy:435

Stops the PIXIAnimation and destroys it

PIXIAnimation.preloadBaseTextures

(
  • renderer
)

This method makes sure that all the base textures are in the gpu to prevent framerate lurches later due to loading base textures as their textures appear.

Parameters:

  • renderer PIXI.WebGLRenderer

PIXIAnimation.unloadBaseTextures

()

This method cleans out all PIXIAnimation baseTextures at the end of a scene.

formatSpriteSheet

(
  • spriteSheet
)
Object

Defined in formatSpriteSheet:505

Available since 0.8.4

This method formats a provided value into a valid PIXIAnimation Sprite Sheet. This includes accepting the EaselJS spec, strings mapping to Platypus sprite sheets, or arrays of either.

Parameters:

Returns:

Properties

currentAnimation

String

Defined in currentAnimation:216

Available since 0.9.2

The currently playing animation name.

Default: ""

paused

Unknown

Defined in paused:295

The PIXIAnimations paused state. If paused, the animation doesn't update.

visible

Unknown

Defined in visible:265

The visibility of the sprite.