TGUI  0.9.5
Loading...
Searching...
No Matches
tgui::RelativeValue Struct Reference

Helper class to create an AbsoluteOrRelativeValue object containing a relative value without using a string. More...

#include <TGUI/AbsoluteOrRelativeValue.hpp>

Inheritance diagram for tgui::RelativeValue:
tgui::AbsoluteOrRelativeValue

Public Member Functions

TGUI_CONSTEXPR RelativeValue (float ratio)
 
- Public Member Functions inherited from tgui::AbsoluteOrRelativeValue
TGUI_CONSTEXPR AbsoluteOrRelativeValue ()
 Default constructor.
 
template<typename T , typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
TGUI_CONSTEXPR AbsoluteOrRelativeValue (T constant)
 Constructor to set constant.
 
 AbsoluteOrRelativeValue (const char *expression)
 Construct the value from a string that either contains a value or a percentage.
 
 AbsoluteOrRelativeValue (const String &expression)
 Construct the value from a string that either contains a value or a percentage.
 
TGUI_CONSTEXPR float getValue () const
 Returns the value.
 
TGUI_CONSTEXPR float getRatio () const
 Returns the stored ratio.
 
TGUI_CONSTEXPR bool isConstant () const
 Returns whether the value is constant or a ratio.
 
TGUI_CONSTEXPR void updateParentSize (float newParentSize)
 
String toString () const
 

Additional Inherited Members

- Protected Attributes inherited from tgui::AbsoluteOrRelativeValue
bool m_constant = true
 
float m_value = 0
 
float m_ratio = 0
 
float m_parentValue = 0
 

Detailed Description

Helper class to create an AbsoluteOrRelativeValue object containing a relative value without using a string.


The documentation for this struct was generated from the following file: