added "Updated Turkish Translation" by Learath2
[twcon.git] / src / engine / textrender.h
blobddd2be5b762a59d89f11b901123853569521c0af
1 /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2 /* If you are missing that file, acquire a complete release at teeworlds.com. */
3 #ifndef ENGINE_TEXTRENDER_H
4 #define ENGINE_TEXTRENDER_H
5 #include "kernel.h"
7 enum
9 TEXTFLAG_RENDER=1,
10 TEXTFLAG_ALLOW_NEWLINE=2,
11 TEXTFLAG_STOP_AT_END=4
14 class CFont;
16 class CTextCursor
18 public:
19 int m_Flags;
20 int m_LineCount;
21 int m_CharCount;
22 int m_MaxLines;
24 float m_StartX;
25 float m_StartY;
26 float m_LineWidth;
27 float m_X, m_Y;
29 CFont *m_pFont;
30 float m_FontSize;
33 class ITextRender : public IInterface
35 MACRO_INTERFACE("textrender", 0)
36 public:
37 virtual void SetCursor(CTextCursor *pCursor, float x, float y, float FontSize, int Flags) = 0;
39 virtual CFont *LoadFont(const char *pFilename) = 0;
40 virtual void DestroyFont(CFont *pFont) = 0;
42 virtual void SetDefaultFont(CFont *pFont) = 0;
45 virtual void TextEx(CTextCursor *pCursor, const char *pText, int Length) = 0;
47 // old foolish interface
48 virtual void TextColor(float r, float g, float b, float a) = 0;
49 virtual void TextOutlineColor(float r, float g, float b, float a) = 0;
50 virtual void Text(void *pFontSetV, float x, float y, float Size, const char *pText, int MaxWidth) = 0;
51 virtual float TextWidth(void *pFontSetV, float Size, const char *pText, int Length) = 0;
52 virtual int TextLineCount(void *pFontSetV, float Size, const char *pText, float LineWidth) = 0;
55 class IEngineTextRender : public ITextRender
57 MACRO_INTERFACE("enginetextrender", 0)
58 public:
59 virtual void Init() = 0;
62 extern IEngineTextRender *CreateEngineTextRender();
64 #endif