|
stmm-games-doc
0.32.0
|
Tile animation made of images. More...
Public Member Functions | |
| TileAni () noexcept | |
| Constructor. More... | |
| void | setDefaultImage (const shared_ptr< Image > &refImage) noexcept |
| Set the default image. More... | |
| const shared_ptr< Image > & | getDefaultImage () noexcept |
| The default image. More... | |
| void | addImage (int32_t nDuration, const shared_ptr< Image > &refImage) noexcept |
| Adds an image to the tile animation. More... | |
| const shared_ptr< Image > & | getImage (double fElapsed) noexcept |
| The image at a certain point in the animation. More... | |
| const shared_ptr< Image > & | getImage (double fElapsed, int32_t &nIdx) noexcept |
| The image and the index at a certain point in the animation. More... | |
| int32_t | getTotImages () const noexcept |
| The nummber of images added. More... | |
| const shared_ptr< Image > & | getImageByIdx (int32_t nIdx) noexcept |
| The image by index. More... | |
Tile animation made of images.
Each image in the animation has a duration weight.
The elapsed time is not in milliseconds but a number from 0.0 to 1.0. Elapsed 0.0 is the start of the animation and 1.0 is the end.
|
noexcept |
Constructor.
|
noexcept |
Adds an image to the tile animation.
| nDuration | The duration weight. Must be a positive number. |
| refImage | The image. Can be null. |
|
noexcept |
The default image.
|
noexcept |
The image at a certain point in the animation.
If no image was added the default image is returned.
| fElapsed | The elapsed "time". Must be >= 0.0 and <= 1.0. |
|
noexcept |
The image and the index at a certain point in the animation.
If no image was added index -1 and the default image is returned.
| fElapsed | The elapsed "time". Must be >= 0.0 and <= 1.0. |
| nIdx | The index of the image or -1 if none was added. (output). |
|
noexcept |
The image by index.
| nIdx | The index. Must be >= 0 and < getTotImages(). |
|
noexcept |
The nummber of images added.
|
noexcept |
Set the default image.
The default image can only be set once.
| refImage | The default image. Can be null. |
1.8.13