TachyonUI 1.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::StyleBlend Struct Reference

A box's look as a mix of up to four of its state styles (flat GPU style indices, as GUIRenderer::StyleIndex gives them), each with its share; the shares add up to 1, the heaviest first. More...

#include <gui_core/graphics/gui_renderer.h>

Public Member Functions

bool IsBlending () const
float WeightOf (uint32_t style) const
 The share of style; 0 when it isn't in the mix.

Static Public Member Functions

static StyleBlend Single (uint32_t style)
static StyleBlend Between (uint32_t from, uint32_t to, float t)
 from mixed with to, t (0 to 1) of the way to to.

Public Attributes

std::array< uint32_t, kMaxStyles > styles {}
std::array< float, kMaxStyles > weights { 1.0f, 0.0f, 0.0f, 0.0f }
uint8_t count = 1

Static Public Attributes

static constexpr int kMaxStyles = 4

Detailed Description

A box's look as a mix of up to four of its state styles (flat GPU style indices, as GUIRenderer::StyleIndex gives them), each with its share; the shares add up to 1, the heaviest first.

One style, all of it, for a box that isn't changing state.

Member Function Documentation

◆ Single()

StyleBlend tachyon::StyleBlend::Single ( uint32_t style)
inlinestatic

◆ Between()

StyleBlend tachyon::StyleBlend::Between ( uint32_t from,
uint32_t to,
float t )
inlinestatic

from mixed with to, t (0 to 1) of the way to to.

◆ IsBlending()

bool tachyon::StyleBlend::IsBlending ( ) const
inline

◆ WeightOf()

float tachyon::StyleBlend::WeightOf ( uint32_t style) const
inline

The share of style; 0 when it isn't in the mix.

Member Data Documentation

◆ kMaxStyles

int tachyon::StyleBlend::kMaxStyles = 4
staticconstexpr

◆ styles

std::array<uint32_t, kMaxStyles> tachyon::StyleBlend::styles {}

◆ weights

std::array<float, kMaxStyles> tachyon::StyleBlend::weights { 1.0f, 0.0f, 0.0f, 0.0f }

◆ count

uint8_t tachyon::StyleBlend::count = 1

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