OpenTTD Source: src/texteff.hpp File Reference

OpenTTD Source 13.2.1

Typedefs | Enumerations | Functions
texteff.hpp File Reference
`#include "economy_type.h"`
`#include "gfx_type.h"`
`#include "strings_type.h"`

Go to the source code of this file.

## Typedefs
typedef size_t | TextEffectID

## Enumerations
enum | TextEffectMode { TE_RISING, TE_STATIC, INVALID_TE_ID = 0xFFFF }
| Text effect modes. More...

## Functions
void | MoveAllTextEffects (uint delta_ms)
TextEffectID | AddTextEffect (StringID msg, int x, int y, uint8 duration, TextEffectMode mode)
void | InitTextEffects ()
void | DrawTextEffects (DrawPixelInfo *dpi)
void | UpdateTextEffect (TextEffectID effect_id, StringID msg)
void | RemoveTextEffect (TextEffectID effect_id)
void | UpdateAllTextEffectVirtCoords ()
TextEffectID | ShowFillingPercent (int x, int y, int z, uint8 percent, StringID colour)
| Display vehicle loading indicators. More...
void | UpdateFillingPercent (TextEffectID te_id, uint8 percent, StringID colour)
| Update vehicle loading indicators. More...
void | HideFillingPercent (TextEffectID *te_id)
| Hide vehicle loading indicators. More...
void | ShowCostOrIncomeAnimation (int x, int y, int z, Money cost)
| Display animated income or costs on the map. More...
void | ShowFeederIncomeAnimation (int x, int y, int z, Money transfer, Money income)
| Display animated feeder income. More...

## Detailed Description

Functions related to text effects.

Definition in file texteff.hpp.

## Enumeration Type Documentation

## ◆ TextEffectMode

enum TextEffectMode

Text effect modes.

Enumerator
TE_RISING | Make the text effect slowly go upwards.
TE_STATIC | Keep the text effect static.

Definition at line 20 of file texteff.hpp.

## Function Documentation

## ◆ HideFillingPercent()

void HideFillingPercent | ( | TextEffectID * | te_id | ) |

Hide vehicle loading indicators.

Parameters

  *te_id | TextEffectID which is supposed to be hidden.

Definition at line 650 of file misc_gui.cpp.

Referenced by Train::Crash(), and Vehicle::PreDestructor().

## ◆ ShowCostOrIncomeAnimation()

void ShowCostOrIncomeAnimation | ( | int | x,
|  | int | y,
|  | int | z,
|  | Money | cost
| ) |  |

Display animated income or costs on the map.

Does nothing if cost is zero.

Parameters

  x | World X position of the animation location.
  y | World Y position of the animation location.
  z | World Z position of the animation location.
  cost | Estimated cost (or income if negative).

Definition at line 572 of file misc_gui.cpp.

## ◆ ShowFeederIncomeAnimation()

void ShowFeederIncomeAnimation | ( | int | x,
|  | int | y,
|  | int | z,
|  | Money | transfer,
|  | Money | income
| ) |  |

Display animated feeder income.

Parameters

  x | World X position of the animation location.
  y | World Y position of the animation location.
  z | World Z position of the animation location.
  transfer | Estimated feeder income.
  income | Real income from goods being delivered to their final destination.

Definition at line 596 of file misc_gui.cpp.

## ◆ ShowFillingPercent()

TextEffectID ShowFillingPercent | ( | int | x,
|  | int | y,
|  | int | z,
|  | uint8 | percent,
|  | StringID | string
| ) |  |

Display vehicle loading indicators.

Parameters

  x | World X position of the animation location.
  y | World Y position of the animation location.
  z | World Z position of the animation location.
  percent | Estimated feeder income.
  string | String which is drawn on the map.

Returns
  TextEffectID to be used for future updates of the loading indicators.

Definition at line 623 of file misc_gui.cpp.

## ◆ UpdateFillingPercent()

void UpdateFillingPercent | ( | TextEffectID | te_id,
|  | uint8 | percent,
|  | StringID | string
| ) |  |

Update vehicle loading indicators.

Parameters

  te_id | TextEffectID to be updated.
  string | String which is printed.

Definition at line 638 of file misc_gui.cpp.

References SetDParam().