|
stmm-games-doc
0.32.0
|
Background animation. More...

Classes | |
| struct | Init |
Public Member Functions | |
| BackgroundAnimation (const Init &oInit) noexcept | |
| Constructor. More... | |
| int32_t | getImageId () const noexcept |
| The current image id. More... | |
| FPoint | getImageRelPos () const noexcept |
| The current relative position of the image within the animation rectangle. More... | |
| FSize | getImageSize () const noexcept |
| The size of the image. More... | |
| void | setImage (int32_t nImgId, const FSize &oNewSize, const FPoint &oImgRelPos) noexcept |
| Set the repeated image to fill the animation rectangle. More... | |
| void | moveImageTo (const FPoint &oNewRelPos) noexcept |
| Sets the new relative position of the pattern origin. More... | |
| FPoint | getImageRelPos (int32_t nViewTick, int32_t nTotViewTicks) const noexcept |
| The position of the image origin within animation during view ticks. More... | |
| void | boardAfterScroll (Direction::VALUE eDir) noexcept |
Public Member Functions inherited from stmg::LevelAnimation | |
| virtual | ~LevelAnimation () noexcept=default |
| int32_t | getId () const noexcept |
| Returns unique Id of this object. More... | |
| bool | isActive () const noexcept |
| Whether the animation was added to the level (and not removed yet). More... | |
| int32_t | getViewAnimationNameIdx () const noexcept |
| The optional view animation name index. More... | |
| REFSYS | getRefSys () noexcept |
| The reference system of the animation. More... | |
| FPoint | getPos () const noexcept |
| The current position of the animation within its reference system. More... | |
| FSize | getSize () const noexcept |
| The size of the animation. More... | |
| int32_t | getZ () const noexcept |
| The depth of the animation. More... | |
| double | gameInterval () const noexcept |
| The current game interval. More... | |
| double | getDuration () const noexcept |
| The duration in milliseconds. More... | |
| void | moveTo (FPoint oPos) noexcept |
| Sets new position within reference system. More... | |
| void | moveTo (int32_t nZ) noexcept |
| Sets new position within reference system. More... | |
| virtual void | onScrolled (Direction::VALUE eDir) noexcept |
| Called by Level when the animation is scrolled by Level::boardScroll. More... | |
| double | getElapsed (int32_t nViewTick, int32_t nTotViewTicks) const noexcept |
| The time elapsed since the animation was started in milliseconds. More... | |
| bool | isStarted (int32_t nViewTick, int32_t nTotViewTicks) const noexcept |
| Whether the animation has already started. More... | |
| bool | isDone (int32_t nViewTick, int32_t nTotViewTicks) const noexcept |
| Whether the animation has finished. More... | |
| Level & | level () noexcept |
| The level. More... | |
| const Level & | level () const noexcept |
| The level. More... | |
| GameProxy & | game () noexcept |
| The game. More... | |
| const GameProxy & | game () const noexcept |
| The game. More... | |
Protected Member Functions | |
| void | reInit (const Init &oInit) noexcept |
| See constructor. More... | |
Protected Member Functions inherited from stmg::LevelAnimation | |
| LevelAnimation (const Init &oInit) noexcept | |
| Constructor. More... | |
| void | reInit (const Init &oInit) noexcept |
| Reinitialization. More... | |
Additional Inherited Members | |
Public Types inherited from stmg::LevelAnimation | |
| enum | REFSYS { REFSYS_BOARD = -3, REFSYS_SHOW = -2, REFSYS_INVALID = -1, REFSYS_SUBSHOW = 0 } |
| Reference system extended enumeration. More... | |
Static Public Attributes inherited from stmg::LevelAnimation | |
| static const double | s_fDurationUndefined |
| Undefined duration constant. More... | |
| static const double | s_fDurationInfinity |
| Infinite duration constant. More... | |
Background animation.
This animation has a fixed size within its reference system. Within the animation rectangle an image is used as pattern to fill it. The pattern origin (its top left corner) is set relative to the animation top left corner. The image id, position and size can change at runtime.
|
explicitnoexcept |
Constructor.
| oInit | The initialization parameters. |
|
noexcept |
|
inlinenoexcept |
The current image id.
|
inlinenoexcept |
The current relative position of the image within the animation rectangle.
|
noexcept |
The position of the image origin within animation during view ticks.
Used to interpolate between current (game tick) position and the new (next game tick) position.
| nViewTick | Must be >= 0 and < nTotViewTicks. |
| nTotViewTicks | Must be > 0. |
|
inlinenoexcept |
The size of the image.
If one of the returned size components (oSize.m_fW and oNewSize.m_fH) is <= 0 the ratio of the natural size of the image should be used. If both oSize.m_fW and oSize.m_fH are <= 0 the natural size should be used.
|
noexcept |
Sets the new relative position of the pattern origin.
The new position is reached in a game tick interpolating the view tick position from the old position.
| oNewRelPos | The new relative position (in tiles). |
|
protectednoexcept |
See constructor.
|
noexcept |
Set the repeated image to fill the animation rectangle.
If one of oNewSize.m_fW and oNewSize.m_fH is <= 0 the ratio of the natural size of the image should be used. If both oNewSize.m_fW and oNewSize.m_fH are <= 0 the the natural size should be used by the view.
Set the image to -1 to hide temporarily the animation.
| nImgId | The image id. Must be valid id in `level().getNamed().images() or -1. |
| oNewSize | The new size of the image. |
| oImgRelPos | The relative position of the image in respect to the position of the animation. |
1.8.13