SDOM - Simple SDL Document Object Model
A lightweight, extensible Document Object Model for SDL-based applications.
Loading...
Searching...
No Matches
SDOM::Label Class Reference

#include <SDOM_Label.hpp>

Inheritance diagram for SDOM::Label:
SDOM::IDisplayObject SDOM::IDataObject SDOM::IUnitTest

Classes

struct  InitStruct
 
struct  LabelToken
 
struct  PhraseToken
 

Public Types

enum class  TokenType {
  Word , Escape , Space , Punctuation ,
  Newline , Tab
}
 
enum class  RenderPass { Dropshadow , Outline , Foreground }
 
enum class  OrphanRetentionPolicy : int { RetainUntilManual , AutoDestroy , GracePeriod }
 

Public Member Functions

 Label ()=default
 
virtual ~Label () override
 
virtual bool onInit () override
 
virtual void onQuit () override
 
virtual void onUpdate (float fElapsedTime) override
 
virtual void onEvent (const Event &event) override
 
virtual void onRender () override
 
virtual bool onUnitTest () override
 Runs unit tests for this object.
 
void setText (std::string p_text)
 
std::string getText () const
 
AssetHandle getFont () const
 
IFontObject::FontType getFontType () const
 
int getGlyphHeight () const
 
FontStylegetDefaultStyle ()
 
void setDefaultStyle (const FontStyle &style)
 
bool isPunctuation (char c)
 
int tokenizeText ()
 
void renderLabel ()
 
void renderLabelPass (RenderPass pass)
 
const std::vector< LabelToken > & getTokenList () const
 
const std::string & getLastTokenizedText () const
 
const std::map< AlignQueue, std::vector< LabelToken > > & getTokenAlignLists () const
 
const std::map< AlignQueue, std::vector< PhraseToken > > & getPhraseAlignLists () const
 
OrphanRetentionPolicy getOrphanRetentionPolicy () const
 
IDisplayObjectsetOrphanRetentionPolicy (OrphanRetentionPolicy policy)
 
std::chrono::milliseconds getOrphanGrace () const
 
IDisplayObjectsetOrphanGrace (std::chrono::milliseconds grace)
 
bool operator== (const IDisplayObject &other) const
 
bool operator< (const IDisplayObject &other) const
 
bool operator!= (const IDisplayObject &other) const
 
bool operator> (const IDisplayObject &other) const
 
bool operator<= (const IDisplayObject &other) const
 
bool operator>= (const IDisplayObject &other) const
 
void cleanAll ()
 
bool getDirty () const
 
IDisplayObjectsetDirty ()
 
IDisplayObjectsetDirty (bool grime)
 
bool isDirty () const
 
void printTree (int depth=0, bool isLast=true, const std::vector< bool > &hasMoreSiblings={}) const
 
void addEventListener (EventType &type, std::function< void(Event &)> listener, bool useCapture=false, int priority=0)
 
void removeEventListener (EventType &type, std::function< void(Event &)> listener, bool useCapture=false)
 
void triggerEventListeners (Event &event, bool useCapture)
 
bool hasEventListeners (const EventType &type, bool useCapture) const
 
void queue_event (const EventType &type, std::function< void(Event &)> init_payload)
 
void addChild (DisplayHandle child, bool useWorld=false, int worldX=0, int worldY=0)
 
DisplayHandle getChild (std::string name) const
 
bool removeChild (DisplayHandle child)
 
bool removeChild (const std::string &name)
 
const std::vector< DisplayHandle > & getChildren () const
 
DisplayHandle getParent () const
 
IDisplayObjectsetParent (const DisplayHandle &parent)
 
bool hasChild (DisplayHandle child) const
 
bool isAncestorOf (DisplayHandle descendant) const
 
bool isAncestorOf (const std::string &name) const
 
bool isDescendantOf (DisplayHandle ancestor) const
 
bool isDescendantOf (const std::string &name) const
 
bool removeFromParent ()
 
bool removeDescendant (DisplayHandle descendant)
 
bool removeDescendant (const std::string &descendantName)
 
std::string getType () const
 
IDisplayObjectsetType (const std::string &newType)
 
Bounds getBounds () const
 
IDisplayObjectsetBounds (const Bounds &b)
 
SDL_Color getColor () const
 
IDisplayObjectsetColor (const SDL_Color &color)
 
int getMaxPriority () const
 
int getMinPriority () const
 
int getPriority () const
 
IDisplayObjectsetToHighestPriority ()
 
IDisplayObjectsetToLowestPriority ()
 
IDisplayObjectsortChildrenByPriority ()
 
IDisplayObjectsetPriority (int priority)
 
std::vector< int > getChildrenPriorities () const
 
IDisplayObjectmoveToTop ()
 
int getZOrder () const
 
IDisplayObjectsetZOrder (int z_order)
 
void setKeyboardFocus ()
 
bool isKeyboardFocused () const
 
bool isMouseHovered () const
 
bool isClickable () const
 
IDisplayObjectsetClickable (bool clickable)
 
bool isEnabled () const
 
IDisplayObjectsetEnabled (bool enabled)
 
bool isHidden () const
 
IDisplayObjectsetHidden (bool hidden)
 
bool isVisible () const
 
IDisplayObjectsetVisible (bool visible)
 
int getTabPriority () const
 
IDisplayObjectsetTabPriority (int index)
 
bool isTabEnabled () const
 
IDisplayObjectsetTabEnabled (bool enabled)
 
int getX () const
 
int getY () const
 
int getWidth () const
 
int getHeight () const
 
IDisplayObjectsetX (int p_x)
 
IDisplayObjectsetY (int p_y)
 
IDisplayObjectsetWidth (int width)
 
IDisplayObjectsetHeight (int height)
 
AnchorPoint getAnchorTop () const
 
AnchorPoint getAnchorLeft () const
 
AnchorPoint getAnchorBottom () const
 
AnchorPoint getAnchorRight () const
 
void setAnchorTop (AnchorPoint ap)
 
void setAnchorLeft (AnchorPoint ap)
 
void setAnchorBottom (AnchorPoint ap)
 
void setAnchorRight (AnchorPoint ap)
 
float getLeft () const
 
float getRight () const
 
float getTop () const
 
float getBottom () const
 
IDisplayObjectsetLeft (float p_left)
 
IDisplayObjectsetRight (float p_right)
 
IDisplayObjectsetTop (float p_top)
 
IDisplayObjectsetBottom (float p_bottom)
 
float getLocalX () const
 
float getLocalY () const
 
float getLocalWidth () const
 
float getLocalHeight () const
 
float getLocalLeft () const
 
float getLocalRight () const
 
float getLocalTop () const
 
float getLocalBottom () const
 
IDisplayObjectsetLocalLeft (float value)
 
IDisplayObjectsetLocalRight (float value)
 
IDisplayObjectsetLocalTop (float value)
 
IDisplayObjectsetLocalBottom (float value)
 
std::string getName () const
 
void setName (const std::string &newName)
 
void registerLuaBindings (const std::string &typeName, sol::state_view lua)
 

Static Public Member Functions

static std::unique_ptr< IDisplayObjectCreateFromLua (const sol::table &config)
 
static std::unique_ptr< IDisplayObjectCreateFromInitStruct (const Label::InitStruct &baseInit)
 
template<typename T >
static T lua_value_case_insensitive (const sol::table &tbl, const std::string &key, const T &default_value)
 

Static Public Attributes

static constexpr const char * TypeName = "Label"
 
static const std::unordered_map< LabelAlign, std::string > labelAlignToString_
 
static const std::unordered_map< std::string, LabelAlignstringToLabelAlign_
 

Protected Types

enum class  AlignQueue : uint8_t {
  TOP_LEFT = 0b0000 , TOP_CENTER = 0b0001 , TOP_RIGHT = 0b0010 , MIDDLE_LEFT = 0b0011 ,
  MIDDLE_CENTER = 0b0100 , MIDDLE_RIGHT = 0b0101 , BOTTOM_LEFT = 0b0110 , BOTTOM_CENTER = 0b0111 ,
  BOTTOM_RIGHT = 0b1000 , DEFAULT = 0b0000 , LEFT = 0b0011 , CENTER = 0b0100 ,
  RIGHT = 0b0101 , TOP = 0b0001 , MIDDLE = 0b0100 , BOTTOM = 0b0111
}
 

Protected Member Functions

 Label (const InitStruct &init)
 
 Label (const sol::table &config)
 
void _buildTokenAlignLists ()
 
void _debugToken (const LabelToken &token)
 
void _maxSize (float &width, float &height)
 
void _buildPhraseAlignLists ()
 
bool needsTextureRebuild_ (int width, int height, SDL_PixelFormat fmt) const
 
bool rebuildTexture_ (int width, int height, SDL_PixelFormat fmt=SDL_PIXELFORMAT_RGBA8888)
 
virtual void _registerLuaBindings (const std::string &typeName, sol::state_view lua)
 
void attachChild_ (DisplayHandle child, DisplayHandle parent, bool useWorld=false, int worldX=0, int worldY=0)
 
void removeOrphan_ (const DisplayHandle &orphan)
 

Protected Attributes

friend Factory
 
friend Core
 
std::string text_
 
std::string lastTokenizedText_ = ""
 
int fontSize_
 
int fontWidth_
 
int fontHeight_
 
IFontObject::FontType fontType_ = IFontObject::FontType::Bitmap
 
AssetHandle fontAsset
 
FontStyle defaultStyle_
 
std::string resourceName_
 
bool userFontWidthSpecified_ = false
 
bool userFontHeightSpecified_ = false
 
SDL_Texture * cachedTexture_ = nullptr
 
std::vector< LabelTokentokenList
 
std::unordered_map< LabelAlign, AlignQueuealignXRef_
 
std::map< AlignQueue, std::vector< LabelToken > > tokenAlignLists_
 
std::map< AlignQueue, std::vector< PhraseToken > > phraseAlignLists_
 
SDL_PixelFormat current_pixel_format = SDL_PIXELFORMAT_UNKNOWN
 
int current_width = 0
 
int current_height = 0
 
int parent_width_ = 0
 
int parent_height_ = 0
 
float left_ = 0.0f
 
float top_ = 0.0f
 
float right_ = 0.0f
 
float bottom_ = 0.0f
 
std::string type_
 
bool bIsDirty_ = false
 
SDL_Color color_ = {255, 255, 255, 255}
 
SDL_Color foregroundColor_ = {255, 255, 255, 255}
 
SDL_Color backgroundColor_ = {255, 255, 255, 128}
 
SDL_Color borderColor_ = {0, 0, 0, 128}
 
SDL_Color outlineColor_ = {0, 0, 0, 255}
 
SDL_Color dropshadowColor_ = {0, 0, 0, 128}
 
AnchorPoint anchorTop_ = AnchorPoint::TOP_LEFT
 
AnchorPoint anchorLeft_ = AnchorPoint::TOP_LEFT
 
AnchorPoint anchorBottom_ = AnchorPoint::TOP_LEFT
 
AnchorPoint anchorRight_ = AnchorPoint::TOP_LEFT
 
int z_order_ = 0
 
int priority_ = 0
 
bool isClickable_ = false
 
bool isEnabled_ = true
 
bool isHidden_ = false
 
int tabPriority_ = -1
 
bool tabEnabled_ = false
 
DisplayHandle parent_
 
std::vector< DisplayHandlechildren_
 
std::unordered_map< EventType, std::vector< ListenerEntry >, EventTypeHashcaptureEventListeners
 
std::unordered_map< EventType, std::vector< ListenerEntry >, EventTypeHashbubblingEventListeners
 
sol::usertype< IDisplayObjectobjHandleType_
 
std::string name_ = "IDataObject"
 

Member Enumeration Documentation

◆ AlignQueue

enum class SDOM::Label::AlignQueue : uint8_t
strongprotected
Enumerator
TOP_LEFT 
TOP_CENTER 
TOP_RIGHT 
MIDDLE_LEFT 
MIDDLE_CENTER 
MIDDLE_RIGHT 
BOTTOM_LEFT 
BOTTOM_CENTER 
BOTTOM_RIGHT 
DEFAULT 
LEFT 
CENTER 
RIGHT 
TOP 
MIDDLE 
BOTTOM 

◆ OrphanRetentionPolicy

enum class SDOM::IDisplayObject::OrphanRetentionPolicy : int
stronginherited
Enumerator
RetainUntilManual 
AutoDestroy 
GracePeriod 

◆ RenderPass

enum class SDOM::Label::RenderPass
strong
Enumerator
Dropshadow 
Outline 
Foreground 

◆ TokenType

enum class SDOM::Label::TokenType
strong
Enumerator
Word 
Escape 
Space 
Punctuation 
Newline 
Tab 

Constructor & Destructor Documentation

◆ Label() [1/3]

SDOM::Label::Label ( const InitStruct init)
protected

◆ Label() [2/3]

SDOM::Label::Label ( const sol::table &  config)
protected

◆ Label() [3/3]

SDOM::Label::Label ( )
default

◆ ~Label()

SDOM::Label::~Label ( )
overridevirtual

Member Function Documentation

◆ _buildPhraseAlignLists()

void SDOM::Label::_buildPhraseAlignLists ( )
protected

◆ _buildTokenAlignLists()

void SDOM::Label::_buildTokenAlignLists ( )
protected

◆ _debugToken()

void SDOM::Label::_debugToken ( const LabelToken token)
protected

◆ _maxSize()

void SDOM::Label::_maxSize ( float &  width,
float &  height 
)
protected

◆ _registerLuaBindings()

void SDOM::Label::_registerLuaBindings ( const std::string &  typeName,
sol::state_view  lua 
)
protectedvirtual

Reimplemented from SDOM::IDisplayObject.

◆ addChild()

void SDOM::IDisplayObject::addChild ( DisplayHandle  child,
bool  useWorld = false,
int  worldX = 0,
int  worldY = 0 
)
inherited

◆ addEventListener()

void SDOM::IDisplayObject::addEventListener ( EventType type,
std::function< void(Event &)>  listener,
bool  useCapture = false,
int  priority = 0 
)
inherited

◆ attachChild_()

void SDOM::IDisplayObject::attachChild_ ( DisplayHandle  child,
DisplayHandle  parent,
bool  useWorld = false,
int  worldX = 0,
int  worldY = 0 
)
protectedinherited

◆ cleanAll()

void SDOM::IDisplayObject::cleanAll ( )
inherited

◆ CreateFromInitStruct()

static std::unique_ptr< IDisplayObject > SDOM::Label::CreateFromInitStruct ( const Label::InitStruct baseInit)
inlinestatic

◆ CreateFromLua()

static std::unique_ptr< IDisplayObject > SDOM::Label::CreateFromLua ( const sol::table &  config)
inlinestatic

◆ getAnchorBottom()

AnchorPoint SDOM::IDisplayObject::getAnchorBottom ( ) const
inlineinherited

◆ getAnchorLeft()

AnchorPoint SDOM::IDisplayObject::getAnchorLeft ( ) const
inlineinherited

◆ getAnchorRight()

AnchorPoint SDOM::IDisplayObject::getAnchorRight ( ) const
inlineinherited

◆ getAnchorTop()

AnchorPoint SDOM::IDisplayObject::getAnchorTop ( ) const
inlineinherited

◆ getBottom()

float SDOM::IDisplayObject::getBottom ( ) const
inherited

◆ getBounds()

Bounds SDOM::IDisplayObject::getBounds ( ) const
inlineinherited

◆ getChild()

DisplayHandle SDOM::IDisplayObject::getChild ( std::string  name) const
inherited

◆ getChildren()

const std::vector< DisplayHandle > & SDOM::IDisplayObject::getChildren ( ) const
inherited

◆ getChildrenPriorities()

std::vector< int > SDOM::IDisplayObject::getChildrenPriorities ( ) const
inherited

◆ getColor()

SDL_Color SDOM::IDisplayObject::getColor ( ) const
inlineinherited

◆ getDefaultStyle()

FontStyle & SDOM::Label::getDefaultStyle ( )
inline

◆ getDirty()

bool SDOM::IDisplayObject::getDirty ( ) const
inlineinherited

◆ getFont()

AssetHandle SDOM::Label::getFont ( ) const
inline

◆ getFontType()

IFontObject::FontType SDOM::Label::getFontType ( ) const
inline

◆ getGlyphHeight()

int SDOM::Label::getGlyphHeight ( ) const
inline

◆ getHeight()

int SDOM::IDisplayObject::getHeight ( ) const
inherited

◆ getLastTokenizedText()

const std::string & SDOM::Label::getLastTokenizedText ( ) const
inline

◆ getLeft()

float SDOM::IDisplayObject::getLeft ( ) const
inherited

◆ getLocalBottom()

float SDOM::IDisplayObject::getLocalBottom ( ) const
inlineinherited

◆ getLocalHeight()

float SDOM::IDisplayObject::getLocalHeight ( ) const
inlineinherited

◆ getLocalLeft()

float SDOM::IDisplayObject::getLocalLeft ( ) const
inlineinherited

◆ getLocalRight()

float SDOM::IDisplayObject::getLocalRight ( ) const
inlineinherited

◆ getLocalTop()

float SDOM::IDisplayObject::getLocalTop ( ) const
inlineinherited

◆ getLocalWidth()

float SDOM::IDisplayObject::getLocalWidth ( ) const
inlineinherited

◆ getLocalX()

float SDOM::IDisplayObject::getLocalX ( ) const
inlineinherited

◆ getLocalY()

float SDOM::IDisplayObject::getLocalY ( ) const
inlineinherited

◆ getMaxPriority()

int SDOM::IDisplayObject::getMaxPriority ( ) const
inherited

◆ getMinPriority()

int SDOM::IDisplayObject::getMinPriority ( ) const
inherited

◆ getName()

std::string SDOM::IDataObject::getName ( ) const
inlineinherited

◆ getOrphanGrace()

std::chrono::milliseconds SDOM::IDisplayObject::getOrphanGrace ( ) const
inlineinherited

◆ getOrphanRetentionPolicy()

OrphanRetentionPolicy SDOM::IDisplayObject::getOrphanRetentionPolicy ( ) const
inlineinherited

◆ getParent()

DisplayHandle SDOM::IDisplayObject::getParent ( ) const
inherited

◆ getPhraseAlignLists()

const std::map< AlignQueue, std::vector< PhraseToken > > & SDOM::Label::getPhraseAlignLists ( ) const
inline

◆ getPriority()

int SDOM::IDisplayObject::getPriority ( ) const
inlineinherited

◆ getRight()

float SDOM::IDisplayObject::getRight ( ) const
inherited

◆ getTabPriority()

int SDOM::IDisplayObject::getTabPriority ( ) const
inherited

◆ getText()

std::string SDOM::Label::getText ( ) const
inline

◆ getTokenAlignLists()

const std::map< AlignQueue, std::vector< LabelToken > > & SDOM::Label::getTokenAlignLists ( ) const
inline

◆ getTokenList()

const std::vector< LabelToken > & SDOM::Label::getTokenList ( ) const
inline

◆ getTop()

float SDOM::IDisplayObject::getTop ( ) const
inherited

◆ getType()

std::string SDOM::IDisplayObject::getType ( ) const
inlineinherited

◆ getWidth()

int SDOM::IDisplayObject::getWidth ( ) const
inherited

◆ getX()

int SDOM::IDisplayObject::getX ( ) const
inherited

◆ getY()

int SDOM::IDisplayObject::getY ( ) const
inherited

◆ getZOrder()

int SDOM::IDisplayObject::getZOrder ( ) const
inlineinherited

◆ hasChild()

bool SDOM::IDisplayObject::hasChild ( DisplayHandle  child) const
inherited

◆ hasEventListeners()

bool SDOM::IDisplayObject::hasEventListeners ( const EventType type,
bool  useCapture 
) const
inherited

◆ isAncestorOf() [1/2]

bool SDOM::IDisplayObject::isAncestorOf ( const std::string &  name) const
inherited

◆ isAncestorOf() [2/2]

bool SDOM::IDisplayObject::isAncestorOf ( DisplayHandle  descendant) const
inherited

◆ isClickable()

bool SDOM::IDisplayObject::isClickable ( ) const
inlineinherited

◆ isDescendantOf() [1/2]

bool SDOM::IDisplayObject::isDescendantOf ( const std::string &  name) const
inherited

◆ isDescendantOf() [2/2]

bool SDOM::IDisplayObject::isDescendantOf ( DisplayHandle  ancestor) const
inherited

◆ isDirty()

bool SDOM::IDisplayObject::isDirty ( ) const
inlineinherited

◆ isEnabled()

bool SDOM::IDisplayObject::isEnabled ( ) const
inlineinherited

◆ isHidden()

bool SDOM::IDisplayObject::isHidden ( ) const
inlineinherited

◆ isKeyboardFocused()

bool SDOM::IDisplayObject::isKeyboardFocused ( ) const
inherited

◆ isMouseHovered()

bool SDOM::IDisplayObject::isMouseHovered ( ) const
inherited

◆ isPunctuation()

bool SDOM::Label::isPunctuation ( char  c)

◆ isTabEnabled()

bool SDOM::IDisplayObject::isTabEnabled ( ) const
inherited

◆ isVisible()

bool SDOM::IDisplayObject::isVisible ( ) const
inlineinherited

◆ lua_value_case_insensitive()

template<typename T >
static T SDOM::IDataObject::lua_value_case_insensitive ( const sol::table &  tbl,
const std::string &  key,
const T &  default_value 
)
inlinestaticinherited

◆ moveToTop()

IDisplayObject & SDOM::IDisplayObject::moveToTop ( )
inherited

◆ needsTextureRebuild_()

bool SDOM::Label::needsTextureRebuild_ ( int  width,
int  height,
SDL_PixelFormat  fmt 
) const
protected

◆ onEvent()

void SDOM::Label::onEvent ( const Event event)
overridevirtual

Reimplemented from SDOM::IDisplayObject.

◆ onInit()

bool SDOM::Label::onInit ( )
overridevirtual

Reimplemented from SDOM::IDisplayObject.

◆ onQuit()

void SDOM::Label::onQuit ( )
overridevirtual

Reimplemented from SDOM::IDisplayObject.

◆ onRender()

void SDOM::Label::onRender ( )
overridevirtual

Implements SDOM::IDisplayObject.

◆ onUnitTest()

bool SDOM::Label::onUnitTest ( )
overridevirtual

Runs unit tests for this object.

Returns
true if all tests pass, false otherwise.

Reimplemented from SDOM::IDisplayObject.

◆ onUpdate()

void SDOM::Label::onUpdate ( float  fElapsedTime)
overridevirtual

Reimplemented from SDOM::IDisplayObject.

◆ operator!=()

bool SDOM::IDisplayObject::operator!= ( const IDisplayObject other) const
inlineinherited

◆ operator<()

bool SDOM::IDisplayObject::operator< ( const IDisplayObject other) const
inlineinherited

◆ operator<=()

bool SDOM::IDisplayObject::operator<= ( const IDisplayObject other) const
inlineinherited

◆ operator==()

bool SDOM::IDisplayObject::operator== ( const IDisplayObject other) const
inlineinherited

◆ operator>()

bool SDOM::IDisplayObject::operator> ( const IDisplayObject other) const
inlineinherited

◆ operator>=()

bool SDOM::IDisplayObject::operator>= ( const IDisplayObject other) const
inlineinherited

◆ printTree()

void SDOM::IDisplayObject::printTree ( int  depth = 0,
bool  isLast = true,
const std::vector< bool > &  hasMoreSiblings = {} 
) const
inherited

◆ queue_event()

void SDOM::IDisplayObject::queue_event ( const EventType type,
std::function< void(Event &)>  init_payload 
)
inherited

◆ rebuildTexture_()

bool SDOM::Label::rebuildTexture_ ( int  width,
int  height,
SDL_PixelFormat  fmt = SDL_PIXELFORMAT_RGBA8888 
)
protected

◆ registerLuaBindings()

void SDOM::IDataObject::registerLuaBindings ( const std::string &  typeName,
sol::state_view  lua 
)
inlineinherited

◆ removeChild() [1/2]

bool SDOM::IDisplayObject::removeChild ( const std::string &  name)
inherited

◆ removeChild() [2/2]

bool SDOM::IDisplayObject::removeChild ( DisplayHandle  child)
inherited

◆ removeDescendant() [1/2]

bool SDOM::IDisplayObject::removeDescendant ( const std::string &  descendantName)
inherited

◆ removeDescendant() [2/2]

bool SDOM::IDisplayObject::removeDescendant ( DisplayHandle  descendant)
inherited

◆ removeEventListener()

void SDOM::IDisplayObject::removeEventListener ( EventType type,
std::function< void(Event &)>  listener,
bool  useCapture = false 
)
inherited

◆ removeFromParent()

bool SDOM::IDisplayObject::removeFromParent ( )
inherited

◆ removeOrphan_()

void SDOM::IDisplayObject::removeOrphan_ ( const DisplayHandle orphan)
protectedinherited

◆ renderLabel()

void SDOM::Label::renderLabel ( )

◆ renderLabelPass()

void SDOM::Label::renderLabelPass ( RenderPass  pass)

◆ setAnchorBottom()

void SDOM::IDisplayObject::setAnchorBottom ( AnchorPoint  ap)
inherited

◆ setAnchorLeft()

void SDOM::IDisplayObject::setAnchorLeft ( AnchorPoint  ap)
inherited

◆ setAnchorRight()

void SDOM::IDisplayObject::setAnchorRight ( AnchorPoint  ap)
inherited

◆ setAnchorTop()

void SDOM::IDisplayObject::setAnchorTop ( AnchorPoint  ap)
inherited

◆ setBottom()

IDisplayObject & SDOM::IDisplayObject::setBottom ( float  p_bottom)
inherited

◆ setBounds()

IDisplayObject & SDOM::IDisplayObject::setBounds ( const Bounds b)
inlineinherited

◆ setClickable()

IDisplayObject & SDOM::IDisplayObject::setClickable ( bool  clickable)
inlineinherited

◆ setColor()

IDisplayObject & SDOM::IDisplayObject::setColor ( const SDL_Color &  color)
inlineinherited

◆ setDefaultStyle()

void SDOM::Label::setDefaultStyle ( const FontStyle style)
inline

◆ setDirty() [1/2]

IDisplayObject & SDOM::IDisplayObject::setDirty ( )
inlineinherited

◆ setDirty() [2/2]

IDisplayObject & SDOM::IDisplayObject::setDirty ( bool  grime)
inlineinherited

◆ setEnabled()

IDisplayObject & SDOM::IDisplayObject::setEnabled ( bool  enabled)
inlineinherited

◆ setHeight()

IDisplayObject & SDOM::IDisplayObject::setHeight ( int  height)
inherited

◆ setHidden()

IDisplayObject & SDOM::IDisplayObject::setHidden ( bool  hidden)
inlineinherited

◆ setKeyboardFocus()

void SDOM::IDisplayObject::setKeyboardFocus ( )
inherited

◆ setLeft()

IDisplayObject & SDOM::IDisplayObject::setLeft ( float  p_left)
inherited

◆ setLocalBottom()

IDisplayObject & SDOM::IDisplayObject::setLocalBottom ( float  value)
inlineinherited

◆ setLocalLeft()

IDisplayObject & SDOM::IDisplayObject::setLocalLeft ( float  value)
inlineinherited

◆ setLocalRight()

IDisplayObject & SDOM::IDisplayObject::setLocalRight ( float  value)
inlineinherited

◆ setLocalTop()

IDisplayObject & SDOM::IDisplayObject::setLocalTop ( float  value)
inlineinherited

◆ setName()

void SDOM::IDataObject::setName ( const std::string &  newName)
inlineinherited

◆ setOrphanGrace()

IDisplayObject & SDOM::IDisplayObject::setOrphanGrace ( std::chrono::milliseconds  grace)
inlineinherited

◆ setOrphanRetentionPolicy()

IDisplayObject & SDOM::IDisplayObject::setOrphanRetentionPolicy ( OrphanRetentionPolicy  policy)
inlineinherited

◆ setParent()

IDisplayObject & SDOM::IDisplayObject::setParent ( const DisplayHandle parent)
inherited

◆ setPriority()

IDisplayObject & SDOM::IDisplayObject::setPriority ( int  priority)
inherited

◆ setRight()

IDisplayObject & SDOM::IDisplayObject::setRight ( float  p_right)
inherited

◆ setTabEnabled()

IDisplayObject & SDOM::IDisplayObject::setTabEnabled ( bool  enabled)
inherited

◆ setTabPriority()

IDisplayObject & SDOM::IDisplayObject::setTabPriority ( int  index)
inherited

◆ setText()

void SDOM::Label::setText ( std::string  p_text)

◆ setToHighestPriority()

IDisplayObject & SDOM::IDisplayObject::setToHighestPriority ( )
inherited

◆ setToLowestPriority()

IDisplayObject & SDOM::IDisplayObject::setToLowestPriority ( )
inherited

◆ setTop()

IDisplayObject & SDOM::IDisplayObject::setTop ( float  p_top)
inherited

◆ setType()

IDisplayObject & SDOM::IDisplayObject::setType ( const std::string &  newType)
inlineinherited

◆ setVisible()

IDisplayObject & SDOM::IDisplayObject::setVisible ( bool  visible)
inlineinherited

◆ setWidth()

IDisplayObject & SDOM::IDisplayObject::setWidth ( int  width)
inherited

◆ setX()

IDisplayObject & SDOM::IDisplayObject::setX ( int  p_x)
inherited

◆ setY()

IDisplayObject & SDOM::IDisplayObject::setY ( int  p_y)
inherited

◆ setZOrder()

IDisplayObject & SDOM::IDisplayObject::setZOrder ( int  z_order)
inlineinherited

◆ sortChildrenByPriority()

IDisplayObject & SDOM::IDisplayObject::sortChildrenByPriority ( )
inherited

◆ tokenizeText()

int SDOM::Label::tokenizeText ( )

◆ triggerEventListeners()

void SDOM::IDisplayObject::triggerEventListeners ( Event event,
bool  useCapture 
)
inherited

Member Data Documentation

◆ alignXRef_

std::unordered_map<LabelAlign, AlignQueue> SDOM::Label::alignXRef_
protected
Initial value:
=
{
}

◆ anchorBottom_

AnchorPoint SDOM::IDisplayObject::anchorBottom_ = AnchorPoint::TOP_LEFT
protectedinherited

◆ anchorLeft_

AnchorPoint SDOM::IDisplayObject::anchorLeft_ = AnchorPoint::TOP_LEFT
protectedinherited

◆ anchorRight_

AnchorPoint SDOM::IDisplayObject::anchorRight_ = AnchorPoint::TOP_LEFT
protectedinherited

◆ anchorTop_

AnchorPoint SDOM::IDisplayObject::anchorTop_ = AnchorPoint::TOP_LEFT
protectedinherited

◆ backgroundColor_

SDL_Color SDOM::IDisplayObject::backgroundColor_ = {255, 255, 255, 128}
protectedinherited

◆ bIsDirty_

bool SDOM::IDisplayObject::bIsDirty_ = false
protectedinherited

◆ borderColor_

SDL_Color SDOM::IDisplayObject::borderColor_ = {0, 0, 0, 128}
protectedinherited

◆ bottom_

float SDOM::IDisplayObject::bottom_ = 0.0f
protectedinherited

◆ bubblingEventListeners

std::unordered_map<EventType, std::vector<ListenerEntry>, EventTypeHash> SDOM::IDisplayObject::bubblingEventListeners
protectedinherited

◆ cachedTexture_

SDL_Texture* SDOM::Label::cachedTexture_ = nullptr
protected

◆ captureEventListeners

std::unordered_map<EventType, std::vector<ListenerEntry>, EventTypeHash> SDOM::IDisplayObject::captureEventListeners
protectedinherited

◆ children_

std::vector<DisplayHandle> SDOM::IDisplayObject::children_
protectedinherited

◆ color_

SDL_Color SDOM::IDisplayObject::color_ = {255, 255, 255, 255}
protectedinherited

◆ Core

friend SDOM::Label::Core
protected

◆ current_height

int SDOM::Label::current_height = 0
protected

◆ current_pixel_format

SDL_PixelFormat SDOM::Label::current_pixel_format = SDL_PIXELFORMAT_UNKNOWN
protected

◆ current_width

int SDOM::Label::current_width = 0
protected

◆ defaultStyle_

FontStyle SDOM::Label::defaultStyle_
protected

◆ dropshadowColor_

SDL_Color SDOM::IDisplayObject::dropshadowColor_ = {0, 0, 0, 128}
protectedinherited

◆ Factory

friend SDOM::Label::Factory
protected

◆ fontAsset

AssetHandle SDOM::Label::fontAsset
protected

◆ fontHeight_

int SDOM::Label::fontHeight_
protected

◆ fontSize_

int SDOM::Label::fontSize_
protected

◆ fontType_

IFontObject::FontType SDOM::Label::fontType_ = IFontObject::FontType::Bitmap
protected

◆ fontWidth_

int SDOM::Label::fontWidth_
protected

◆ foregroundColor_

SDL_Color SDOM::IDisplayObject::foregroundColor_ = {255, 255, 255, 255}
protectedinherited

◆ isClickable_

bool SDOM::IDisplayObject::isClickable_ = false
protectedinherited

◆ isEnabled_

bool SDOM::IDisplayObject::isEnabled_ = true
protectedinherited

◆ isHidden_

bool SDOM::IDisplayObject::isHidden_ = false
protectedinherited

◆ labelAlignToString_

const std::unordered_map<LabelAlign, std::string> SDOM::Label::labelAlignToString_
inlinestatic
Initial value:
= {
{ LabelAlign::DEFAULT, "default" },
{ LabelAlign::LEFT, "left" },
{ LabelAlign::CENTER, "center" },
{ LabelAlign::RIGHT, "right" },
{ LabelAlign::TOP, "top" },
{ LabelAlign::TOP_LEFT, "top_left" },
{ LabelAlign::TOP_CENTER, "top_center" },
{ LabelAlign::TOP_RIGHT, "top_right" },
{ LabelAlign::MIDDLE, "middle" },
{ LabelAlign::MIDDLE_LEFT, "middle_left" },
{ LabelAlign::MIDDLE_CENTER,"middle_center" },
{ LabelAlign::MIDDLE_RIGHT, "middle_right" },
{ LabelAlign::BOTTOM, "bottom" },
{ LabelAlign::BOTTOM_LEFT, "bottom_left" },
{ LabelAlign::BOTTOM_CENTER,"bottom_center" },
{ LabelAlign::BOTTOM_RIGHT, "bottom_right" }
}

◆ lastTokenizedText_

std::string SDOM::Label::lastTokenizedText_ = ""
protected

◆ left_

float SDOM::IDisplayObject::left_ = 0.0f
protectedinherited

◆ name_

std::string SDOM::IDataObject::name_ = "IDataObject"
protectedinherited

◆ objHandleType_

sol::usertype<IDisplayObject> SDOM::IDisplayObject::objHandleType_
protectedinherited

◆ outlineColor_

SDL_Color SDOM::IDisplayObject::outlineColor_ = {0, 0, 0, 255}
protectedinherited

◆ parent_

DisplayHandle SDOM::IDisplayObject::parent_
protectedinherited

◆ parent_height_

int SDOM::Label::parent_height_ = 0
protected

◆ parent_width_

int SDOM::Label::parent_width_ = 0
protected

◆ phraseAlignLists_

std::map<AlignQueue, std::vector<PhraseToken> > SDOM::Label::phraseAlignLists_
protected

◆ priority_

int SDOM::IDisplayObject::priority_ = 0
protectedinherited

◆ resourceName_

std::string SDOM::Label::resourceName_
protected

◆ right_

float SDOM::IDisplayObject::right_ = 0.0f
protectedinherited

◆ stringToLabelAlign_

const std::unordered_map<std::string, LabelAlign> SDOM::Label::stringToLabelAlign_
inlinestatic
Initial value:
= {
{ "default", LabelAlign::DEFAULT },
{ "left", LabelAlign::LEFT },
{ "center", LabelAlign::CENTER },
{ "right", LabelAlign::RIGHT },
{ "top", LabelAlign::TOP },
{ "top_left", LabelAlign::TOP_LEFT },
{ "top_center", LabelAlign::TOP_CENTER },
{ "top_right", LabelAlign::TOP_RIGHT },
{ "middle", LabelAlign::MIDDLE },
{ "middle_left", LabelAlign::MIDDLE_LEFT },
{ "middle_center", LabelAlign::MIDDLE_CENTER },
{ "middle_right", LabelAlign::MIDDLE_RIGHT },
{ "bottom", LabelAlign::BOTTOM },
{ "bottom_left", LabelAlign::BOTTOM_LEFT },
{ "bottom_center", LabelAlign::BOTTOM_CENTER },
{ "bottom_right", LabelAlign::BOTTOM_RIGHT },
}

◆ tabEnabled_

bool SDOM::IDisplayObject::tabEnabled_ = false
protectedinherited

◆ tabPriority_

int SDOM::IDisplayObject::tabPriority_ = -1
protectedinherited

◆ text_

std::string SDOM::Label::text_
protected

◆ tokenAlignLists_

std::map<AlignQueue, std::vector<LabelToken> > SDOM::Label::tokenAlignLists_
protected

◆ tokenList

std::vector<LabelToken> SDOM::Label::tokenList
protected

◆ top_

float SDOM::IDisplayObject::top_ = 0.0f
protectedinherited

◆ type_

std::string SDOM::IDisplayObject::type_
protectedinherited

◆ TypeName

constexpr const char* SDOM::Label::TypeName = "Label"
staticconstexpr

◆ userFontHeightSpecified_

bool SDOM::Label::userFontHeightSpecified_ = false
protected

◆ userFontWidthSpecified_

bool SDOM::Label::userFontWidthSpecified_ = false
protected

◆ z_order_

int SDOM::IDisplayObject::z_order_ = 0
protectedinherited

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