stmm-games-doc  0.32.0
Classes | Public Member Functions | List of all members
stmg::FadeModifier Class Reference

Fading effect to a sub-modifier. More...

Inheritance diagram for stmg::FadeModifier:
Inheritance graph
[legend]

Classes

struct  Init
 
struct  LocalInit
 

Public Member Functions

 FadeModifier (Init &&oInit) noexcept
 Constructor. More...
 
FLOW_CONTROL drawTile (const Cairo::RefPtr< Cairo::Context > &refCc, StdThemeDrawingContext &oDc, const Tile &oTile, int32_t nPlayer, const std::vector< double > &aAniElapsed) noexcept override
 Draw tile (with player skin). More...
 
- Public Member Functions inherited from stmg::ContainerModifier
 ContainerModifier (Init &&oInit) noexcept
 Constructor. More...
 
void registerTileSize (int32_t nW, int32_t nH) noexcept override
 Register tile size. More...
 
void unregisterTileSize (int32_t nW, int32_t nH) noexcept override
 Unregister tile size. More...
 
virtual void applyToSubModifiers (const std::function< void(StdThemeModifier &)> &oApply) noexcept
 Apply a function to all the submodifiers. More...
 
- Public Member Functions inherited from stmg::StdThemeModifier
virtual ~StdThemeModifier () noexcept=default
 
int32_t getDebugTag () const noexcept
 The debug tag. More...
 

Additional Inherited Members

- Public Types inherited from stmg::StdThemeModifier
enum  FLOW_CONTROL { FLOW_CONTROL_CONTINUE = 0, FLOW_CONTROL_STOP = 1 }
 
- Static Public Member Functions inherited from stmg::ContainerModifier
static FLOW_CONTROL drawTile (const std::vector< unique_ptr< StdThemeModifier > > &aModifiers, const Cairo::RefPtr< Cairo::Context > &refCc, StdThemeDrawingContext &oDc, const Tile &oTile, int32_t nPlayer, const std::vector< double > &aAniElapsed) noexcept
 
- Protected Member Functions inherited from stmg::ContainerModifier
FLOW_CONTROL drawContainedToWorkSurface (StdThemeDrawingContext &oDc, const Tile &oTile, int32_t nPlayer, const std::vector< double > &aAniElapsed, Cairo::RefPtr< Cairo::Surface > &refSurface) noexcept
 
- Protected Member Functions inherited from stmg::StdThemeModifier
 StdThemeModifier (Init &&oInit) noexcept
 Constructor. More...
 
StdThemeowner () noexcept
 The theme. More...
 
const StdThemeowner () const noexcept
 The theme. More...
 

Detailed Description

Fading effect to a sub-modifier.

This modifier fades the sub-modifiers: from [elapsed == 0.0] alpha=255 (opaque), to [elapsed == 1.0] alpha=0 (invisible). If elapsed is -1 the sub-modifiers are drawn opaque even if inverted. The elapsed mapping is applied first.

Constructor & Destructor Documentation

◆ FadeModifier()

stmg::FadeModifier::FadeModifier ( Init &&  oInit)
explicitnoexcept

Constructor.

The two params m_nElapsedTileAniIdx and m_fDefaultElapsed cannot be both undefined.

Parameters
oInitThe initialization data.

Member Function Documentation

◆ drawTile()

FLOW_CONTROL stmg::FadeModifier::drawTile ( const Cairo::RefPtr< Cairo::Context > &  refCc,
StdThemeDrawingContext oDc,
const Tile oTile,
int32_t  nPlayer,
const std::vector< double > &  aAniElapsed 
)
overridevirtualnoexcept

Draw tile (with player skin).

Parameters
refCcThe cairo context. Cannot be null.
oDcThe theme drawing context. Cannot be null.
oTileThe tile to draw.
nPlayerThe player the tile "belongs" to. -1 means no player. Must be >= -1.
aAniElapsedThe tile animations current value.
Returns
Whether the caller should continue or stop painting.

Reimplemented from stmg::ContainerModifier.