OpenBarnyard
 
Loading...
Searching...
No Matches
AGUI2TextBox.h
Go to the documentation of this file.
1#pragma once
2#include "AGUI2Element.h"
3#include "AGUI2Font.h"
4
5#include <Toshi/TColor.h>
6
8{
9public:
10 // constructors/destructor
13
14 void Create( AGUI2Font* a_pFont, TFLOAT a_fWidth );
15
16 void SetText( const TWCHAR* a_wszText );
17 void SetScale( TFLOAT a_fScale );
18 void SetShadow( TBOOL a_bEnabled, TUINT32 a_uiColour );
19 void SetShadowEnabled( TBOOL a_bEnabled );
20 void SetShadowColour( const Toshi::TColor& a_rColour );
21 void SetShadowColour( TUINT32 a_uiColour );
22 void SetShadowOffset( TFLOAT a_fOffsetX, TFLOAT a_fOffsetY );
23 void SetTextAlign( AGUI2Font::TextAlign a_eTextAlign );
24
25 const TWCHAR* GetText() const { return m_wszText; }
26 TFLOAT GetShadowOffsetX() const { return m_fShadowOffsetX; }
27 TFLOAT GetShadowOffsetY() const { return m_fShadowOffsetY; }
28
29 //-----------------------------------------------------------------------------
30 // AGUI2Element
31 //-----------------------------------------------------------------------------
32 virtual void Render() OVERRIDE;
33 virtual void GetDimensions( TFLOAT& a_rWidth, TFLOAT& a_rHeight ) OVERRIDE;
34 virtual TFLOAT GetWidth() OVERRIDE;
35 virtual TFLOAT GetHeight() OVERRIDE;
36 virtual void SetWidth( TFLOAT a_fWidth ) OVERRIDE;
37 virtual void SetShadowAlpha( TFLOAT a_fAlpha ) OVERRIDE;
38
39private:
40 void RenderText( void* a_fnCallback );
41
42private:
43 TBOOL m_bRenderShadow;
44 TFLOAT m_fShadowOffsetX;
45 TFLOAT m_fShadowOffsetY;
46 TUINT32 m_uiShadowColour;
47 const TWCHAR* m_wszText;
48 AGUI2Font* m_pFont;
49 TFLOAT m_fScale;
50 AGUI2Font::TextAlign m_eTextAlign;
51 TBOOL m_bDimensionsDirty;
52 TBOOL m_bUnkFlag2;
53};
#define OVERRIDE
Definition Defines.h:12
wchar_t TWCHAR
Definition Typedefs.h:21
float TFLOAT
Definition Typedefs.h:4
uint32_t TUINT32
Definition Typedefs.h:13
bool TBOOL
Definition Typedefs.h:6
const TWCHAR * GetText() const
virtual TFLOAT GetWidth() OVERRIDE
void SetTextAlign(AGUI2Font::TextAlign a_eTextAlign)
void SetShadow(TBOOL a_bEnabled, TUINT32 a_uiColour)
void SetShadowColour(const Toshi::TColor &a_rColour)
virtual void SetWidth(TFLOAT a_fWidth) OVERRIDE
virtual void SetShadowAlpha(TFLOAT a_fAlpha) OVERRIDE
virtual void GetDimensions(TFLOAT &a_rWidth, TFLOAT &a_rHeight) OVERRIDE
void SetShadowEnabled(TBOOL a_bEnabled)
TFLOAT GetShadowOffsetX() const
virtual void Render() OVERRIDE
void SetShadowOffset(TFLOAT a_fOffsetX, TFLOAT a_fOffsetY)
TFLOAT GetShadowOffsetY() const
void SetText(const TWCHAR *a_wszText)
void SetScale(TFLOAT a_fScale)
virtual TFLOAT GetHeight() OVERRIDE
void Create(AGUI2Font *a_pFont, TFLOAT a_fWidth)