<static> generateFrameNames(prefix, start, stop, suffix, zeroPad) → {Array.<string>}
Really handy function for when you are creating arrays of animation data but it's using frame names and not numbers.
For example imagine you've got 30 frames named: 'explosion_0001-large' to 'explosion0030-large'
You could use this function to generate those by doing: Phaser.Animation.generateFrameNames('explosion', 1, 30, '-large', 4);
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
prefix | string | The start of the filename. If the filename was 'explosion0001-large' the prefix would be 'explosion'. | ||
start | number | The number to start sequentially counting from. If your frames are named 'explosion_0001' to 'explosion_0034' the start is 1. | ||
stop | number | The number to count to. If your frames are named 'explosion_0001' to 'explosion_0034' the stop value is 34. | ||
suffix | string | <optional> | '' | The end of the filename. If the filename was 'explosion_0001-large' the prefix would be '-large'. |
zeroPad | number | <optional> | 0 | The number of zeros to pad the min and max values with. If your frames are named 'explosion_0001' to 'explosion_0034' then the zeroPad is 4. |
Returns
An array of framenames.
- Source code: animation/Animation.js (Line 828)
Please login to continue.