The theme context for a StdTheme.
More...
|
| | StdThemeContext (Theme::RuntimeVariablesEnv *p0RuntimeVariablesEnv) noexcept |
| | Constructor. More...
|
| |
| void | drawTile (int32_t nPainterIdx, const Cairo::RefPtr< Cairo::Context > &refCc, const Tile &oTile, int32_t nPlayer, const std::vector< double > &aAniElapsed) noexcept override |
| | Draw a tile with tile animations. More...
|
| |
| void | drawTile (int32_t nPainterIdx, const Cairo::RefPtr< Cairo::Context > &refCc, const Tile &oTile, int32_t nPlayer) noexcept override |
| | Draw a tile without tile animations. More...
|
| |
| shared_ptr< ThemeAnimation > | createAnimation (const shared_ptr< LevelAnimation > &refLevelAnimation) noexcept override |
| | Create theme animation. More...
|
| |
| void | preloadSound (int32_t nSoundIdx, const std::vector< shared_ptr< stmi::PlaybackCapability >> &aPlaybacks) noexcept override |
| | Pre-load a sound. More...
|
| |
| shared_ptr< ThemeSound > | createSound (int32_t nSoundIdx, const std::vector< shared_ptr< stmi::PlaybackCapability >> &aPlaybacks, FPoint oXYPosition, double fZPosition, bool bRelative, double fVolume, bool bLoop) noexcept override |
| | Create a sound. More...
|
| |
| NSize | getTileSize () const noexcept override |
| | Get the current tile size. More...
|
| |
| void | setTileSize (NSize oSize) noexcept override |
| | Set the current tile size. More...
|
| |
| const Glib::RefPtr< Pango::Context > & | getFontContext () noexcept override |
| | Get the font context. More...
|
| |
| virtual | ~ThemeContext () noexcept=default |
| |
The theme context for a StdTheme.
◆ StdThemeContext()
◆ createAnimation()
Create theme animation.
- Parameters
-
| refLevelAnimation | The model. Cannot be null. |
- Returns
- The theme animation or null if model not supported.
Implements stmg::ThemeContext.
◆ createSound()
| shared_ptr<ThemeSound> stmg::StdThemeContext::createSound |
( |
int32_t |
nSoundIdx, |
|
|
const std::vector< shared_ptr< stmi::PlaybackCapability >> & |
aPlaybacks, |
|
|
FPoint |
oXYPosition, |
|
|
double |
fZPosition, |
|
|
bool |
bRelative, |
|
|
double |
fVolume, |
|
|
bool |
bLoop |
|
) |
| |
|
overridevirtualnoexcept |
Create a sound.
- Parameters
-
| nSoundIdx | The sound index according to Named::sounds(). Must be non-negative. |
| aPlaybacks | All the devices the sound should be played to. Cannot be empty. Devices can be null. |
| oXYPosition | The x and y position at which the sound should be played. |
| fZPosition | The z position. |
| bRelative | Whether the positions are relative to the listener of each capability. |
| fVolume | The volume. |
| bLoop | Whether the sound(s) should loop. |
- Returns
- The created compound sound or null if sound is not enabled or sound index wrong.
Implements stmg::ThemeContext.
◆ drawTile() [1/2]
| void stmg::StdThemeContext::drawTile |
( |
int32_t |
nPainterIdx, |
|
|
const Cairo::RefPtr< Cairo::Context > & |
refCc, |
|
|
const Tile & |
oTile, |
|
|
int32_t |
nPlayer, |
|
|
const std::vector< double > & |
aAniElapsed |
|
) |
| |
|
overridevirtualnoexcept |
Draw a tile with tile animations.
The elapsed values in aAniElapsed are numbers from 0.0 to 1.0 (or -1.0 if not defined). The index into aAniElapsed is the index into Theme::getNamed().tileAnis().
- Parameters
-
| nPainterIdx | The painter to use. Must be valid. If -1 the theme's default is used. |
| refCc | The drawing context. Cannot be null. |
| oTile | The tile to draw. |
| nPlayer | The level player or -1 if tile not part of a block. |
| aAniElapsed | The elapsed tile animations. |
Implements stmg::ThemeContext.
◆ drawTile() [2/2]
| void stmg::StdThemeContext::drawTile |
( |
int32_t |
nPainterIdx, |
|
|
const Cairo::RefPtr< Cairo::Context > & |
refCc, |
|
|
const Tile & |
oTile, |
|
|
int32_t |
nPlayer |
|
) |
| |
|
overridevirtualnoexcept |
Draw a tile without tile animations.
- Parameters
-
| nPainterIdx | The painter to use. Must be valid. If -1 the theme's default is used. |
| refCc | The drawing context. Cannot be null. |
| oTile | The tile to draw. |
| nPlayer | The level player or -1 if tile not part of a block. |
Implements stmg::ThemeContext.
◆ getFontContext()
| const Glib::RefPtr<Pango::Context>& stmg::StdThemeContext::getFontContext |
( |
| ) |
|
|
overridevirtualnoexcept |
Get the font context.
- Returns
- The pango context used for writing text.
Implements stmg::ThemeContext.
◆ getTileSize()
| NSize stmg::StdThemeContext::getTileSize |
( |
| ) |
const |
|
inlineoverridevirtualnoexcept |
◆ preloadSound()
| void stmg::StdThemeContext::preloadSound |
( |
int32_t |
nSoundIdx, |
|
|
const std::vector< shared_ptr< stmi::PlaybackCapability >> & |
aPlaybacks |
|
) |
| |
|
overridevirtualnoexcept |
Pre-load a sound.
- Parameters
-
| nSoundIdx | The sound index according to Named::sounds(). Must be non-negative. |
| aPlaybacks | All the devices that should pre-load the sound. Cannot be empty. Devices can be null. |
Implements stmg::ThemeContext.
◆ reInit()
◆ setTileSize()
| void stmg::StdThemeContext::setTileSize |
( |
NSize |
oSize | ) |
|
|
overridevirtualnoexcept |
Set the current tile size.
- Parameters
-
| oSize | The new tile size in pixels. Must be positive for both coordinates. |
Implements stmg::ThemeContext.