December 2015
Beginner to intermediate
522 pages
11h 21m
English
A label element is the simplest GUI type yet. It supports all of the default stylistic features but it doesn't do much else other than contain a certain string value that can be loaded in or set at runtime.
Let's take a look at its constructor and destructor:
GUI_Label::GUI_Label(const std::string& l_name,
GUI_Interface* l_owner)
: GUI_Element(l_name, GUI_ElementType::Label, l_owner){}This is nothing short of child's play in comparison to the code we've written before. Its name, type, and owner are set up in the initializer list and there's nothing else to it.
The de-serialization of this type of element is also fairly simple. Recall the following line from an interface file:
Element Label TestLabel 0 0 Default.style "Some text" ...
Read now
Unlock full access