16 m_fShadowOffsetX = 5.0f;
17 m_fShadowOffsetY = 5.0f;
18 m_uiShadowColour = 0x80000000;
31 m_bDimensionsDirty =
TTRUE;
37 m_wszText = a_wszText;
38 m_bDimensionsDirty =
TTRUE;
41void AGUI2TextBox::RenderText(
void* a_fnCallback )
43 if ( m_pFont && m_wszText )
49 TFLOAT fPosX = -fWidth * 0.5f;
50 TFLOAT fPosY = -fHeight * 0.5f;
52 if ( m_bRenderShadow )
56 fPosX + m_fShadowOffsetX,
57 fPosY + m_fShadowOffsetY,
67 m_pFont->DrawTextWrapped(
84 m_bDimensionsDirty =
TTRUE;
89 m_bRenderShadow = a_bEnabled;
90 m_uiShadowColour = a_uiColour;
95 m_bRenderShadow = a_bEnabled;
100 m_uiShadowColour = a_uiColour;
105 m_uiShadowColour = a_rColour.Value32;
110 m_fShadowOffsetX = m_fScale * a_fOffsetX;
111 m_fShadowOffsetY = m_fScale * a_fOffsetY;
116 m_eTextAlign = a_eTextAlign;
140 if ( !m_bUnkFlag2 && m_bDimensionsDirty )
142 if ( !m_wszText || !m_pFont )
151 m_bDimensionsDirty =
TFALSE;
179 m_bDimensionsDirty =
TTRUE;
185 m_uiShadowColour = ( m_uiShadowColour & 0x00FFFFFF ) | ui8Alpha << 24;
TBOOL HasFlags(TUINT32 a_uiFlags) const
void DrawTextWrapped(const TWCHAR *a_wszText, TFLOAT a_fX, TFLOAT a_fY, TFLOAT a_fWidth, TFLOAT a_fHeight, TUINT32 a_uiColour, TFLOAT a_fScale, TextAlign a_eAlign, void *a_fnCallback=nullptr)
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)
virtual void Render() OVERRIDE
void SetShadowOffset(TFLOAT a_fOffsetX, TFLOAT a_fOffsetY)
void SetText(const TWCHAR *a_wszText)
void SetScale(TFLOAT a_fScale)
virtual TFLOAT GetHeight() OVERRIDE
void Create(AGUI2Font *a_pFont, TFLOAT a_fWidth)