OpenBarnyard
 
Loading...
Searching...
No Matches
AGUI2Rectangle Class Reference

#include <AGUI2Rectangle.h>

Inheritance diagram for AGUI2Rectangle:
AGUI2Element AGUI2ElementNode AGUI2MouseCursor

Public Member Functions

 AGUI2Rectangle ()
 
virtual void Render () override
 
void SetTextureSection (AGUI2TextureSection *a_pTexSection)
 Sets material and UVs from AGUI2TextureSection.
 
void Create (TFLOAT a_fWidth, TFLOAT a_fHeight)
 Initialises rectangle with it's width and height.
 
- Public Member Functions inherited from AGUI2Element
 AGUI2Element ()
 
virtual ~AGUI2Element ()=default
 
virtual void Tick (TFLOAT a_fDeltaTime)
 
virtual void PreRender ()
 
virtual void PostRender ()
 
virtual void GetDimensions (TFLOAT &a_rWidth, TFLOAT &a_rHeight)
 
virtual TFLOAT GetWidth ()
 
virtual TFLOAT GetHeight ()
 
virtual void SetWidth (TFLOAT a_fWidth)
 
virtual void SetHeight (TFLOAT a_fHeight)
 
virtual void SetDimensions (TFLOAT a_fWidth, TFLOAT a_fHeight)
 
virtual void GetMins (TFLOAT &a_fX, TFLOAT &a_fY)
 
virtual void GetMaxs (TFLOAT &a_fX, TFLOAT &a_fY)
 
virtual void SetColour (TUINT32 a_uiColour)
 
virtual void SetAlpha (TFLOAT a_fAlpha)
 
virtual void SetShadowAlpha (TFLOAT a_fAlpha)
 
virtual void SetFocus (TBOOL a_bFocused)
 
virtual TBOOL IsPointInside (TFLOAT a_fX, TFLOAT a_fY)
 
void AnchorPos (TFLOAT &a_rX, TFLOAT &a_rY, TFLOAT a_fWidth, TFLOAT a_fHeight)
 
void PivotPos (TFLOAT &a_rX, TFLOAT &a_rY, TFLOAT a_fWidth, TFLOAT a_fHeight)
 
void GetScreenTransform (AGUI2Transform &a_rOutTransform)
 
void GetInvScreenTransform (AGUI2Transform &a_rOutTransform)
 
void Show ()
 
void Hide ()
 
void SetInFront ()
 
void SetRenderBeforeChildren ()
 
TBOOL HasFlags (TUINT32 a_uiFlags) const
 
TBOOL IsVisible () const
 
TBOOL IsFocused () const
 
TBOOL ShouldRenderBeforeChildren ()
 
TBOOL IsInFront () const
 
TFLOAT GetAlpha () const
 
void AddChildTail (AGUI2Element &a_rElement)
 
void AddChildHead (AGUI2Element &a_rElement)
 
void SetTranslation (TFLOAT a_fX, TFLOAT a_fY)
 
void SetTranslation (const Toshi::TVector2 &a_rTranslation)
 
void SetTransform (TFLOAT a_fX, TFLOAT a_fY, float a_fRotAngle=0.0f)
 
void SetAnchor (AGUI2ATTACHMENT a_eAnchor)
 
void SetPivot (AGUI2ATTACHMENT a_ePivot)
 
void SetAttachment (AGUI2ATTACHMENT a_eAnchor, AGUI2ATTACHMENT a_ePivot)
 
t_PostRender SetPostRenderCallback (t_PostRender a_cbNewCallback)
 
AGUI2TransformGetTransform ()
 
AGUI2ElementChildBegin () const
 
AGUI2ElementChildRBegin () const
 
AGUI2ElementGetNextChild (AGUI2Element *a_pCurrentChild)
 
AGUI2ElementGetPrevChild (AGUI2Element *a_pCurrentChild)
 
void RemoveSelf ()
 
void LinkChildBefore (AGUI2Element &a_rNewChildren, AGUI2Element &a_rInsertAfter)
 
- Public Member Functions inherited from AGUI2ElementNode
 AGUI2ElementNode ()
 
virtual ~AGUI2ElementNode ()
 
void Unlink ()
 
void LinkAfter (AGUI2ElementNode &a_rNode)
 
void LinkBefore (AGUI2ElementNode &a_rNode)
 
TBOOL IsLinked () const
 
AGUI2ElementNodeGetNext () const
 
AGUI2ElementNodeGetPrev () const
 

Protected Attributes

AGUI2Materialm_pMaterial
 
Toshi::TVector4 m_UV1
 
Toshi::TVector4 m_UV2
 
- Protected Attributes inherited from AGUI2Element
AGUI2Elementm_pParent
 
AGUI2Transform m_oTransform
 
AGUI2ElementNode m_Children
 
AGUI2ATTACHMENT m_eAnchor
 
AGUI2ATTACHMENT m_ePivot
 
TFLOAT m_fWidth
 
TFLOAT m_fHeight
 
TUINT32 m_uiColour
 
TUINT32 m_eFlags
 
t_PostRender m_cbPostRender
 
TUINT32 m_uiVisibilityMask
 
- Protected Attributes inherited from AGUI2ElementNode
AGUI2ElementNodem_pNext
 
AGUI2ElementNodem_pPrev
 

Additional Inherited Members

- Public Types inherited from AGUI2Element
using t_PostRender = void ( * )()
 
- Public Attributes inherited from AGUI2ElementNode
friend AGUI2Element
 
- Static Public Attributes inherited from AGUI2Element
static TUINT32 s_uiVisibilityMask = 0xFFFFFFFF
 

Detailed Description

Definition at line 8 of file AGUI2Rectangle.h.

Constructor & Destructor Documentation

◆ AGUI2Rectangle()

AGUI2Rectangle::AGUI2Rectangle ( )

Definition at line 11 of file AGUI2Rectangle.cpp.

12{
14}
#define TNULL
Definition Typedefs.h:23
AGUI2Material * m_pMaterial

Member Function Documentation

◆ Create()

void AGUI2Rectangle::Create ( TFLOAT a_fWidth,
TFLOAT a_fHeight )
inline

Initialises rectangle with it's width and height.

Definition at line 25 of file AGUI2Rectangle.h.

26 {
27 AGUI2Element::SetDimensions( a_fWidth, a_fHeight );
28 }
virtual void SetDimensions(TFLOAT a_fWidth, TFLOAT a_fHeight)

◆ Render()

void AGUI2Rectangle::Render ( )
overridevirtual

Reimplemented from AGUI2Element.

Definition at line 16 of file AGUI2Rectangle.cpp.

17{
18 auto pRenderer = AGUI2::GetRenderer();
19
20 pRenderer->SetMaterial( m_pMaterial );
21 pRenderer->SetColour( m_uiColour );
22
23 if ( IsInFront() )
24 {
25 pRenderer->ResetZCoordinate();
26 }
27
28 Toshi::TVector2 pos1 = { -m_fWidth / 2, -m_fHeight / 2 };
29 Toshi::TVector2 pos2 = { pos1.x + m_fWidth, pos1.y + m_fHeight };
30 pRenderer->RenderRectangle( pos1, pos2, m_UV1.AsVector2(), m_UV2.AsVector2() );
31
33}
static AGUI2Renderer * GetRenderer()
Definition AGUI2.cpp:239
virtual void Render()
TUINT32 m_uiColour
TBOOL IsInFront() const
Toshi::TVector4 m_UV2
Toshi::TVector4 m_UV1

◆ SetTextureSection()

void AGUI2Rectangle::SetTextureSection ( AGUI2TextureSection * a_pTexSection)

Sets material and UVs from AGUI2TextureSection.

Parameters
a_pTexSectioncan be TNULL

Definition at line 35 of file AGUI2Rectangle.cpp.

36{
37 if ( a_pTexSection )
38 {
39 m_pMaterial = a_pTexSection->GetMaterial();
40 m_UV1 = a_pTexSection->GetUVPoint1();
41 m_UV2 = a_pTexSection->GetUVPoint2();
42 }
43 else
44 {
46 }
47}
AGUI2Material * GetMaterial()
Toshi::TVector4 & GetUVPoint2()
Toshi::TVector4 & GetUVPoint1()

Member Data Documentation

◆ m_pMaterial

AGUI2Material* AGUI2Rectangle::m_pMaterial
protected

Definition at line 31 of file AGUI2Rectangle.h.

◆ m_UV1

Toshi::TVector4 AGUI2Rectangle::m_UV1
protected

Definition at line 32 of file AGUI2Rectangle.h.

◆ m_UV2

Toshi::TVector4 AGUI2Rectangle::m_UV2
protected

Definition at line 33 of file AGUI2Rectangle.h.


The documentation for this class was generated from the following files: