OpenTTD Source 20250428-master-ga5578166bb
TextEffect Struct Reference

Container for all information about a text effect. More...

Inheritance diagram for TextEffect:
ViewportSign

Public Member Functions

void Reset ()
 Reset the text effect.
 
bool IsValid () const
 
- Public Member Functions inherited from ViewportSign
auto operator<=> (const ViewportSign &) const =default
 
void UpdatePosition (int center, int top, std::string_view str, std::string_view str_small={})
 Update the position of the viewport sign.
 
void MarkDirty (ZoomLevel maxzoom=ZOOM_LVL_MAX) const
 Mark the sign dirty in all viewports.
 

Data Fields

TextEffectMode mode
 Type of text effect.
 
uint8_t duration
 How long the text effect should stay, in ticks (applies only when mode == TE_RISING)
 
EncodedString msg
 Encoded message for text effect.
 
- Data Fields inherited from ViewportSign
int32_t center = 0
 The center position of the sign.
 
int32_t top = 0
 The top of the sign.
 
uint16_t width_normal = 0
 The width when not zoomed out (normal font)
 
uint16_t width_small = 0
 The width when zoomed out (small font)
 

Detailed Description

Container for all information about a text effect.

Definition at line 23 of file texteff.cpp.

Member Function Documentation

◆ IsValid()

bool TextEffect::IsValid ( ) const
inline

Definition at line 36 of file texteff.cpp.

◆ Reset()

void TextEffect::Reset ( )
inline

Reset the text effect.

Definition at line 29 of file texteff.cpp.

References ViewportSign::MarkDirty(), TE_INVALID, and ViewportSign::width_normal.

Field Documentation

◆ duration

uint8_t TextEffect::duration

How long the text effect should stay, in ticks (applies only when mode == TE_RISING)

Definition at line 25 of file texteff.cpp.

◆ mode

TextEffectMode TextEffect::mode

Type of text effect.

Definition at line 24 of file texteff.cpp.

◆ msg

EncodedString TextEffect::msg

Encoded message for text effect.

Definition at line 26 of file texteff.cpp.


The documentation for this struct was generated from the following file: