Falcon
Public Member Functions | Protected Attributes | List of all members
UI::CanvasItem Class Referenceabstract

#include <CanvasItem.h>

Inheritance diagram for UI::CanvasItem:
UI::Button UI::Image UI::Label UI::Panel UI::Slider

Public Member Functions

 CanvasItem ()
 
virtual ~CanvasItem ()
 
void AddChild (CanvasItem *child)
 
void SetBounds (glm::vec4 bounds)
 
void UpdateBounds ()
 
virtual void Draw (nk_context *ctx)
 
virtual void Commands (nk_context *ctx)=0
 
void SetColor (glm::vec4 color)
 
void SetFlags (int32_t flags)
 
void SetActive (bool active)
 
void SetStatus (ItemStatus status)
 

Protected Attributes

struct nk_rect m_bounds
 
nk_color m_color
 
i32 m_flags
 
boost::container::vector< CanvasItem * > m_children
 
CanvasItemparent = nullptr
 
bool m_active = true
 
ItemStatus m_status
 
std::string m_title
 

Detailed Description

Base class for anything drawn on a canvas

Constructor & Destructor Documentation

◆ CanvasItem()

UI::CanvasItem::CanvasItem ( )

Base CanvasItem constructor

◆ ~CanvasItem()

UI::CanvasItem::~CanvasItem ( )
virtual

Canvas item destructor

Member Function Documentation

◆ AddChild()

void UI::CanvasItem::AddChild ( CanvasItem child)

◆ Commands()

virtual void UI::CanvasItem::Commands ( nk_context *  ctx)
pure virtual

◆ Draw()

void UI::CanvasItem::Draw ( nk_context *  ctx)
virtual

Begins a nuklear context, calls the draw commands, then ends drawing

◆ SetActive()

void UI::CanvasItem::SetActive ( bool  active)
inline

◆ SetBounds()

void UI::CanvasItem::SetBounds ( glm::vec4  bounds)

Sets the bounds of the canvas

◆ SetColor()

void UI::CanvasItem::SetColor ( glm::vec4  color)
inline

◆ SetFlags()

void UI::CanvasItem::SetFlags ( int32_t  flags)
inline

◆ SetStatus()

void UI::CanvasItem::SetStatus ( ItemStatus  status)
inline

◆ UpdateBounds()

void UI::CanvasItem::UpdateBounds ( )

Updates the bounds of a mesh

Member Data Documentation

◆ m_active

bool UI::CanvasItem::m_active = true
protected

◆ m_bounds

struct nk_rect UI::CanvasItem::m_bounds
protected

◆ m_children

boost::container::vector<CanvasItem*> UI::CanvasItem::m_children
protected

◆ m_color

nk_color UI::CanvasItem::m_color
protected

◆ m_flags

i32 UI::CanvasItem::m_flags
protected

◆ m_status

ItemStatus UI::CanvasItem::m_status
protected

◆ m_title

std::string UI::CanvasItem::m_title
protected

◆ parent

CanvasItem* UI::CanvasItem::parent = nullptr
protected

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