OpenTTD Source 20241224-master-gf74b0cf984
texteff.hpp
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10#ifndef TEXTEFF_HPP
11#define TEXTEFF_HPP
12
13#include "economy_type.h"
14#include "gfx_type.h"
15#include "strings_type.h"
16
24
25using TextEffectID = uint16_t;
26
27static const TextEffectID INVALID_TE_ID = UINT16_MAX;
28
29TextEffectID AddTextEffect(StringID msg, int x, int y, uint8_t duration, TextEffectMode mode);
30void InitTextEffects();
31void DrawTextEffects(DrawPixelInfo *dpi);
32void UpdateTextEffect(TextEffectID effect_id, StringID msg);
33void RemoveTextEffect(TextEffectID effect_id);
34void UpdateAllTextEffectVirtCoords();
35
36/* misc_gui.cpp */
37TextEffectID ShowFillingPercent(int x, int y, int z, uint8_t percent, StringID colour);
38void UpdateFillingPercent(TextEffectID te_id, uint8_t percent, StringID colour);
39void HideFillingPercent(TextEffectID *te_id);
40
41void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost);
42void ShowFeederIncomeAnimation(int x, int y, int z, Money transfer, Money income);
43
44#endif /* TEXTEFF_HPP */
Types related to the economy.
Types related to the graphics and/or input devices.
Types related to strings.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Data about how and where to blit pixels.
Definition gfx_type.h:157
TextEffectID ShowFillingPercent(int x, int y, int z, uint8_t percent, StringID colour)
Display vehicle loading indicators.
Definition misc_gui.cpp:601
void HideFillingPercent(TextEffectID *te_id)
Hide vehicle loading indicators.
Definition misc_gui.cpp:628
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
Display animated income or costs on the map.
Definition misc_gui.cpp:550
TextEffectMode
Text effect modes.
Definition texteff.hpp:20
@ TE_STATIC
Keep the text effect static.
Definition texteff.hpp:22
@ TE_RISING
Make the text effect slowly go upwards.
Definition texteff.hpp:21
void UpdateFillingPercent(TextEffectID te_id, uint8_t percent, StringID colour)
Update vehicle loading indicators.
Definition misc_gui.cpp:616
void ShowFeederIncomeAnimation(int x, int y, int z, Money transfer, Money income)
Display animated feeder income.
Definition misc_gui.cpp:574