Untitled Game engine no.5
1.0
|
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< VertexCollider2D > | collider = nullptr |
Allignment | origin = CENTER |
collider reference (generated when setting a picture) | |
Public Attributes inherited from Engine::MeshRenderer | |
Ref< ColorMap > | colorMap = nullptr |
Ref< TextureMap > | map = nullptr |
Ref< Texture > | texture = nullptr |
std::vector< Ref< Texture > > | vertexTextures = std::vector<Ref<Texture>>() |
Ref< Mesh > | mesh = nullptr |
Additional Inherited Members | |
Static Public Member Functions inherited from Engine::UIElement | |
static void | Update (const Scene &scene) |
|
inline |
Load a texture and mapping into a hover state.
key | hover state |
texture |
|
inline |
Preform the click action of the button.
|
inline |
Set the function that is called when the button is pressed.
f | function |
|
inline |
Set the hover state of the button.
next |
|
inlineoverridevirtual |
Syncing function called every game tick
Reimplemented from Engine::UIElement.
|
inlineoverridevirtual |
Update the UI element with new visual data
Reimplemented from Engine::UIElement.
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