Untitled Game engine no.5  1.0
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Engine::UIElement Struct Reference

#include <UI.hpp>

Inheritance diagram for Engine::UIElement:
Inheritance graph
[legend]
Collaboration diagram for Engine::UIElement:
Collaboration graph
[legend]

Public Member Functions

 UIElement (const Ref< Texture > &tex)
 
void setImage (const Ref< Texture > &tex)
 
void setImage (const Ref< TextureLookup > &lookup)
 
void setSize (float width, float height)
 
virtual void update ()
 
void queueVisualUpdate ()
 
virtual void updateVisual ()
 
- Public Member Functions inherited from Engine::MeshRenderer
void SetMesh (const Ref< Mesh > &renderMesh)
 
void SetMap (const Ref< Texture > &tex)
 

Static Public Member Functions

static void Update (const Scene &scene)
 

Public Attributes

Ref< VertexCollider2Dcollider = nullptr
 
Allignment origin = CENTER
 collider reference (generated when setting a picture)
 
- Public Attributes inherited from Engine::MeshRenderer
Ref< ColorMapcolorMap = nullptr
 
Ref< TextureMapmap = nullptr
 
Ref< Texturetexture = nullptr
 
std::vector< Ref< Texture > > vertexTextures = std::vector<Ref<Texture>>()
 
Ref< Meshmesh = nullptr
 

Detailed Description

Wrapper for a 2D MeshRenderer. Tells the rendering engine to draw the MeshRenderer with an orthographic projection. TODO: extrapolate all sub classes into this one.

Constructor & Destructor Documentation

◆ UIElement()

Engine::UIElement::UIElement ( const Ref< Texture > &  tex)
inlineexplicit

Generate a ui element from a Texture.

Parameters
texreference

Member Function Documentation

◆ queueVisualUpdate()

void Engine::UIElement::queueVisualUpdate ( )
inline

Flip the updateVisual flag.

◆ setImage() [1/2]

void Engine::UIElement::setImage ( const Ref< Texture > &  tex)
inline

Set the image of the UIElement

Parameters
tex

◆ setImage() [2/2]

void Engine::UIElement::setImage ( const Ref< TextureLookup > &  lookup)
inline

Set the image and mapping data of the UI element.

Parameters
lookup

◆ setSize()

void Engine::UIElement::setSize ( float  width,
float  height 
)
inline

Set the size of the element (useful for alignment and collider calculations)

Parameters
width
height

◆ update()

virtual void Engine::UIElement::update ( )
inlinevirtual

Syncing function called every game tick

Reimplemented in Engine::UIButton.

◆ updateVisual()

virtual void Engine::UIElement::updateVisual ( )
inlinevirtual

Update the UI element with new visual data

Reimplemented in Engine::UIButton.


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