Untitled Game engine no.5  1.0
Public Member Functions | Public Attributes | List of all members
Engine::UIButton Struct Reference
Inheritance diagram for Engine::UIButton:
Inheritance graph
[legend]
Collaboration diagram for Engine::UIButton:
Collaboration graph
[legend]

Public Member Functions

void loadTexture (const ButtonState key, const Ref< TextureLookup > &texture)
 
void setCallback (func f)
 
void preformCallback () const
 
void setState (ButtonState next)
 
void updateVisual () override
 
void update () override
 
- Public Member Functions inherited from Engine::UIElement
 UIElement (const Ref< Texture > &tex)
 
void setImage (const Ref< Texture > &tex)
 
void setImage (const Ref< TextureLookup > &lookup)
 
void setSize (float width, float height)
 
void queueVisualUpdate ()
 
- Public Member Functions inherited from Engine::MeshRenderer
void SetMesh (const Ref< Mesh > &renderMesh)
 
void SetMap (const Ref< Texture > &tex)
 

Public Attributes

func clickFunc
 
ButtonState state = DEFAULT
 generic function for processing clicks
 
ButtonState nextState = DEFAULT
 hover state
 
std::unordered_map< ButtonState, Ref< TextureLookup > > stateLookup = std::unordered_map<ButtonState, Ref<TextureLookup>>()
 next hover state to reduce redraw calls More...
 
- Public Attributes inherited from Engine::UIElement
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
 

Additional Inherited Members

- Static Public Member Functions inherited from Engine::UIElement
static void Update (const Scene &scene)
 

Member Function Documentation

◆ loadTexture()

void Engine::UIButton::loadTexture ( const ButtonState  key,
const Ref< TextureLookup > &  texture 
)
inline

Load a texture and mapping into a hover state.

Parameters
keyhover state
texture

◆ preformCallback()

void Engine::UIButton::preformCallback ( ) const
inline

Preform the click action of the button.

◆ setCallback()

void Engine::UIButton::setCallback ( func  f)
inline

Set the function that is called when the button is pressed.

Parameters
ffunction

◆ setState()

void Engine::UIButton::setState ( ButtonState  next)
inline

Set the hover state of the button.

Parameters
next

◆ update()

void Engine::UIButton::update ( )
inlineoverridevirtual

Syncing function called every game tick

Reimplemented from Engine::UIElement.

◆ updateVisual()

void Engine::UIButton::updateVisual ( )
inlineoverridevirtual

Update the UI element with new visual data

Reimplemented from Engine::UIElement.

Member Data Documentation

◆ stateLookup

std::unordered_map<ButtonState, Ref<TextureLookup> > Engine::UIButton::stateLookup = std::unordered_map<ButtonState, Ref<TextureLookup>>()

next hover state to reduce redraw calls

state texture lookup


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