VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
vex::UIUnitValue Struct Reference

Struct storing unit value logic natively. More...

#include <VexUI.hpp>

Public Member Functions

 UIUnitValue (float v)
 UIUnitValue (float v, UIUnitType t)
UIUnitValue & operator= (float v)
void parse (const nlohmann::json &jval)
 Parses a json value into the unit struct.
nlohmann::json toJson () const
 Converts the unit back to a json-compatible format (preserves strings like "px", "%").
float getPixels (const VexUI *ui) const
 Dynamically calculates the raw pixel representation required for rendering.

Static Public Member Functions

static UIUnitValue parseJson (const nlohmann::json &jval)

Public Attributes

float value = 0.f
UIUnitType type = UIUnitType::Psp

Detailed Description

Struct storing unit value logic natively.

Definition at line 41 of file VexUI.hpp.

Constructor & Destructor Documentation

◆ UIUnitValue() [1/2]

vex::UIUnitValue::UIUnitValue ( float v)
inline

Definition at line 46 of file VexUI.hpp.

◆ UIUnitValue() [2/2]

vex::UIUnitValue::UIUnitValue ( float v,
UIUnitType t )
inline

Definition at line 47 of file VexUI.hpp.

Member Function Documentation

◆ getPixels()

float vex::UIUnitValue::getPixels ( const VexUI * ui) const

Dynamically calculates the raw pixel representation required for rendering.

Definition at line 320 of file VexUI.cpp.

◆ operator=()

UIUnitValue & vex::UIUnitValue::operator= ( float v)
inline

Definition at line 50 of file VexUI.hpp.

◆ parse()

void vex::UIUnitValue::parse ( const nlohmann::json & jval)

Parses a json value into the unit struct.

Definition at line 284 of file VexUI.cpp.

◆ parseJson()

UIUnitValue vex::UIUnitValue::parseJson ( const nlohmann::json & jval)
inlinestatic

Definition at line 58 of file VexUI.hpp.

◆ toJson()

nlohmann::json vex::UIUnitValue::toJson ( ) const

Converts the unit back to a json-compatible format (preserves strings like "px", "%").

Definition at line 306 of file VexUI.cpp.

Member Data Documentation

◆ type

UIUnitType vex::UIUnitValue::type = UIUnitType::Psp

Definition at line 43 of file VexUI.hpp.

◆ value

float vex::UIUnitValue::value = 0.f

Definition at line 42 of file VexUI.hpp.


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