vkmEngine 1.0.15
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::UICanvas Struct Reference

Root of a screen-space UI layer. More...

#include <ui_canvas.h>

Public Types

enum class  ScaleMode : uint8_t { Fixed , ScaleWithHeight , Count }
 How the canvas maps authored pixels to on-screen pixels. More...

Static Public Member Functions

static float scaleIn (const UICanvas &canvas, float viewHeight)
 Screen pixels a pixel of canvas spans, drawn into a view viewHeight pixels tall.

Public Attributes

float referenceHeight = 1080.0f
 Authoring height in pixels; ScaleWithHeight scales against it.
int32_t sortOrder = 0
 Draw order across canvases; higher draws on top.
bool visible = true
 Skip the canvas and its whole subtree when false.

Detailed Description

Root of a screen-space UI layer.

Descendant UIElements lay out against a reference height, scaled uniformly to the live viewport. Several canvases draw in ascending sortOrder.

Member Enumeration Documentation

◆ ScaleMode

enum class Vkm::Engine::UICanvas::ScaleMode : uint8_t
strong

How the canvas maps authored pixels to on-screen pixels.

Enumerator
Fixed 

One authored pixel equals one screen pixel.

ScaleWithHeight 

Scale uniformly by viewportHeight / referenceHeight.

Count 

Sentinel; keep last. Drives the VKM_ENUM_NAMES check.

Member Function Documentation

◆ scaleIn()

float Vkm::Engine::UICanvas::scaleIn ( const UICanvas & canvas,
float viewHeight )
inlinestatic

Screen pixels a pixel of canvas spans, drawn into a view viewHeight pixels tall.

Parameters
canvasThe canvas.
viewHeightThe view's height, in screen pixels.
Returns
The scale its layout is drawn at.

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