new FrameData()
FrameData is a container for Frame objects, which are the internal representation of animation data in Phaser.
- Source:
Members
-
<readonly> total
-
- Source:
Properties:
Name Type Description totalnumber The total number of frames in this FrameData set.
Methods
-
addFrame(frame) → {Phaser.Frame}
-
Adds a new Frame to this FrameData collection. Typically called by the Animation.Parser and not directly.
Parameters:
Name Type Description framePhaser.Frame The frame to add to this FrameData set.
- Source:
Returns:
The frame that was just added.
- Type
- Phaser.Frame
-
checkFrameName(name) → {boolean}
-
Check if there is a Frame with the given name.
Parameters:
Name Type Description namestring The name of the frame you want to check.
- Source:
Returns:
True if the frame is found, otherwise false.
- Type
- boolean
-
getFrame(index) → {Phaser.Frame}
-
Get a Frame by its numerical index.
Parameters:
Name Type Description indexnumber The index of the frame you want to get.
- Source:
Returns:
The frame, if found.
- Type
- Phaser.Frame
-
getFrameByName(name) → {Phaser.Frame}
-
Get a Frame by its frame name.
Parameters:
Name Type Description namestring The name of the frame you want to get.
- Source:
Returns:
The frame, if found.
- Type
- Phaser.Frame
-
getFrameIndexes(frames, useNumericIndex, output) → {Array}
-
Returns all of the Frame indexes in this FrameData set. The frames indexes are returned in the output array, or if none is provided in a new Array object.
Parameters:
Name Type Argument Default Description framesArray An Array containing the indexes of the frames to retrieve. If the array is empty then all frames in the FrameData are returned.
useNumericIndexboolean <optional>
true Are the given frames using numeric indexes (default) or strings? (false)
outputArray <optional>
If given the results will be appended to the end of this array otherwise a new array will be created.
- Source:
Returns:
An array of all Frame indexes matching the given names or IDs.
- Type
- Array
-
getFrameRange(start, end, output) → {Array}
-
Returns a range of frames based on the given start and end frame indexes and returns them in an Array.
Parameters:
Name Type Argument Description startnumber The starting frame index.
endnumber The ending frame index.
outputArray <optional>
If given the results will be appended to the end of this array otherwise a new array will be created.
- Source:
Returns:
An array of Frames between the start and end index values, or an empty array if none were found.
- Type
- Array
-
getFrames(frames, useNumericIndex, output) → {Array}
-
Returns all of the Frames in this FrameData set where the frame index is found in the input array. The frames are returned in the output array, or if none is provided in a new Array object.
Parameters:
Name Type Argument Default Description framesArray An Array containing the indexes of the frames to retrieve. If the array is empty then all frames in the FrameData are returned.
useNumericIndexboolean <optional>
true Are the given frames using numeric indexes (default) or strings? (false)
outputArray <optional>
If given the results will be appended to the end of this array otherwise a new array will be created.
- Source:
Returns:
An array of all Frames in this FrameData set matching the given names or IDs.
- Type
- Array