lxgui
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
lxgui::gui::anchor Class Reference

Stores a position for a UI region. More...

#include <gui_anchor.hpp>

Inheritance diagram for lxgui::gui::anchor:
lxgui::gui::anchor_data

Public Member Functions

 anchor (region &object, const anchor_data &data)
 Constructor.
 
 anchor (const anchor &)=delete
 
 anchor (anchor &&)=delete
 
anchor & operator= (const anchor &)=delete
 
anchor & operator= (anchor &&)=delete
 
vector2f get_point (const region &object) const
 Returns this anchor's absolute coordinates (in pixels).
 
const utils::observer_ptr< region > & get_parent ()
 Returns this anchor's parent region.
 
utils::observer_ptr< const region > get_parent () const
 Returns this anchor's parent region.
 
std::string serialize (const std::string &tab) const
 Prints all relevant information about this anchor in a string.
 
const anchor_data & get_data () const
 Returns the raw data used for this anchor.
 

Public Attributes

point object_point
 
vector2f offset
 
point parent_point
 
anchor_type type
 

Detailed Description

Stores a position for a UI region.

Definition at line 97 of file gui_anchor.hpp.

Constructor & Destructor Documentation

◆ anchor() [1/3]

lxgui::gui::anchor::anchor ( region &  object,
const anchor_data &  data 
)

Constructor.

Parameters
objectThe object to which this anchor belongs
dataThe data about the anchor

Definition at line 15 of file gui_anchor.cpp.

◆ anchor() [2/3]

lxgui::gui::anchor::anchor ( const anchor &  )
delete

◆ anchor() [3/3]

lxgui::gui::anchor::anchor ( anchor &&  )
delete

Member Function Documentation

◆ get_data()

const anchor_data & lxgui::gui::anchor::get_data ( ) const
inline

Returns the raw data used for this anchor.

Returns
The raw data used for this anchor

Definition at line 151 of file gui_anchor.hpp.

◆ get_parent() [1/2]

const utils::observer_ptr< region > & lxgui::gui::anchor::get_parent ( )
inline

Returns this anchor's parent region.

Returns
This anchor's parent region

Definition at line 128 of file gui_anchor.hpp.

◆ get_parent() [2/2]

utils::observer_ptr< const region > lxgui::gui::anchor::get_parent ( ) const
inline

Returns this anchor's parent region.

Returns
This anchor's parent region

Definition at line 136 of file gui_anchor.hpp.

◆ get_point()

vector2f lxgui::gui::anchor::get_point ( const region &  object) const

Returns this anchor's absolute coordinates (in pixels).

Parameters
objectThe object owning this anchor
Returns
The absolute coordinates of this anchor.

Definition at line 55 of file gui_anchor.cpp.

◆ operator=() [1/2]

anchor & lxgui::gui::anchor::operator= ( anchor &&  )
delete

◆ operator=() [2/2]

anchor & lxgui::gui::anchor::operator= ( const anchor &  )
delete

◆ serialize()

std::string lxgui::gui::anchor::serialize ( const std::string &  tab) const

Prints all relevant information about this anchor in a string.

Parameters
tabThe offset to give to all lines
Returns
All relevant information about this anchor

Definition at line 113 of file gui_anchor.cpp.

Member Data Documentation

◆ object_point

point lxgui::gui::anchor_data::object_point

Definition at line 89 of file gui_anchor.hpp.

◆ offset

vector2f lxgui::gui::anchor_data::offset

Definition at line 92 of file gui_anchor.hpp.

◆ parent_point

point lxgui::gui::anchor_data::parent_point

Definition at line 91 of file gui_anchor.hpp.

◆ type

anchor_type lxgui::gui::anchor_data::type

Definition at line 93 of file gui_anchor.hpp.


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