EaselJS

EaselJS  0.3.2

EaselJS > EaselJS > BitmapSequence
Search:
 
Filters

Class BitmapSequence - extends DisplayObject

Displays frames or sequences of frames from a sprite sheet image. A sprite sheet is a series of images (usually animation frames) combined into a single image on a regular grid. For example, an animation consisting of 8 100x100 images could be combined into a 400x200 sprite sheet (4 frames across by 2 high). You can display individual frames, play sequential frames as an animation, and even sequence animations together. See the SpriteSheet class for more information on setting up frames and animation.

Constructor

BitmapSequence ( spriteSheet )
Parameters:
spriteSheet <SpriteSheet> The SpriteSheet instance to play back. This includes the source image, frame dimensions, and frame data. See SpriteSheet for more information.

Properties

callback - Function

Specifies a function to call whenever any sequence reaches its end.

currentEndFrame - final Number

Returns the last frame of the currently playing sequence when using frameData. READ-ONLY.

currentFrame - Number

The frame that will be drawn on the next tick. This can also be set, but it will not update the current sequence, so it may result in unexpected behavior if you are using frameData.
Default Value: -1

currentSequence - final String

Returns the currently playing sequence when using frameData. READ-ONLY.

currentStartFrame - final Number

Returns the first frame of the currently playing sequence when using frameData. READ-ONLY.

nextSequence - final String

Returns the name of the next sequence that will be played, or null if it will stop playing after the current sequence. READ-ONLY.

paused - Boolean

Prevents the animation from advancing each tick automatically. For example, you could create a sprite sheet of icons, set paused to true, and display the appropriate icon by setting currentFrame.
Default Value: false

snapToPixel - Boolean

Whether or not the Bitmap should be draw to the canvas at whole pixel coordinates.
Default Value: true

spriteSheet - SpriteSheet

The SpriteSheet instance to play back. This includes the source image, frame dimensions, and frame data. See SpriteSheet for more information.

Methods

_goto

protected void _goto ( frameOrSequence )
Moves the playhead to the specified frame number of sequence.
Parameters:
frameOrSequence <String|Number> The frame number of sequence that the playhead should move to.
Returns: void

cache

void cache ( )
Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances. You should not cache Bitmap instances as it can degrade performance.
Returns: void

clone

Point clone ( )
Returns a clone of the Point instance.
Returns: Point
a clone of the Point instance.

cloneProps

protected void cloneProps ( o )
Parameters:
o <Text>
Returns: void

draw

void draw ( ctx , ignoreCache )
Draws the display object into the specified context ignoring it's visible, alpha, shadow, and transform. Returns true if the draw was handled (useful for overriding functionality). NOTE: This method is mainly for internal use, though it may be useful for advanced uses.
Parameters:
ctx <CanvasRenderingContext2D> The canvas 2D context object to draw into.
ignoreCache <Boolean> Indicates whether the draw operation should ignore any current cache. For example, used for drawing the cache (to prevent it from simply drawing an existing cache back into itself).
Returns: void

gotoAndPlay

void gotoAndPlay ( frameOrSequence )
Sets paused to false and plays the specified sequence name, named frame, or frame number.
Parameters:
frameOrSequence <String|Number> The frame number or sequence that the playhead should move to and begin playing.
Returns: void

gotoAndStop

void gotoAndStop ( frameOrSequence )
Sets paused to true and seeks to the specified sequence name, named frame, or frame number.
Parameters:
frameOrSequence <String|Number> The frame number or sequence that the playhead should move to and stop.
Returns: void

initialize

protected void initialize ( )
Initialization method.
Returns: void

isVisible

Boolean isVisible ( )
Returns true or false indicating whether the display object would be visible if drawn to a canvas. This does not account for whether it would be visible within the boundaries of the stage. NOTE: This method is mainly for internal use, though it may be useful for advanced uses.
Returns: Boolean
Boolean indicating whether the display object would be visible if drawn to a canvas

tick

void tick ( )
Advances the currentFrame if paused is not true. This is called automatically when the Stage ticks.
Returns: void

toString

String toString ( )
Returns a string representation of this object.
Returns: String
a string representation of the instance.

uncache

void uncache ( )
Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances. You should not cache Bitmap instances as it can degrade performance.
Returns: void

updateCache

void updateCache ( )
Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances. You should not cache Bitmap instances as it can degrade performance.
Returns: void

Events inherited from DisplayObject: