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

Lightweight struct to hold parsed sizes safely away from VexUI dependencies. More...

#include <Layout.hpp>

Public Member Functions

float resolve (float parent) const
 Resolve the flex value to pixels based on parent dimension.
float resolveOr (float parent, float fallback) const
 Resolve the flex value to pixels, with a fallback if unspecified.

Public Attributes

float v = NAN
 Raw value.
bool isPercent = false
 Whether value is a percentage.

Detailed Description

Lightweight struct to hold parsed sizes safely away from VexUI dependencies.

Definition at line 18 of file Layout.hpp.

Member Function Documentation

◆ resolve()

float vex::FlexValue::resolve ( float parent) const
inline

Resolve the flex value to pixels based on parent dimension.

Parameters
parentParent dimension in pixels.
Returns
Resolved value in pixels, or NAN if unspecified.

Definition at line 25 of file Layout.hpp.

◆ resolveOr()

float vex::FlexValue::resolveOr ( float parent,
float fallback ) const
inline

Resolve the flex value to pixels, with a fallback if unspecified.

Parameters
parentParent dimension in pixels.
fallbackValue to return if resolution results in NAN.
Returns
Resolved value in pixels, or fallback if unspecified.

Definition at line 34 of file Layout.hpp.

Member Data Documentation

◆ isPercent

bool vex::FlexValue::isPercent = false

Whether value is a percentage.

Definition at line 20 of file Layout.hpp.

◆ v

float vex::FlexValue::v = NAN

Raw value.

Definition at line 19 of file Layout.hpp.


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