Potato Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
UIElement.hpp
Go to the documentation of this file.
1
2
#pragma once
3
4
#include "
Util/Vector2.hpp
"
5
11
class
UIElement
12
{
13
public
:
14
virtual
~UIElement
() =
default
;
15
17
Vector2
GetScreenSize
()
const
;
19
void
SetScreenSize
(
const
Vector2
& size);
20
22
Vector2
GetScreenPosition
()
const
;
24
void
SetScreenPosition
(
const
Vector2
& ScreenPosition);
// make virtual to override for post-visibility change functionality (always call base method in first line)
25
27
void
AddScreenOffset
(
const
Vector2
& offset);
28
30
bool
isVisible
()
const
;
32
void
SetVisibility
(
bool
visibility);
// make virtual to override for post-visibility change functionality (always call base method in first line)
33
34
private
:
35
Vector2
ScreenSize;
36
Vector2
ScreenPosition;
37
bool
Visible;
38
39
};
Vector2.hpp
UIElement
Wrapper for elements that can be rendered on screen.
Definition
UIElement.hpp:12
UIElement::AddScreenOffset
void AddScreenOffset(const Vector2 &offset)
Adds offset to UI position.
Definition
UIElement.cpp:20
UIElement::SetScreenSize
void SetScreenSize(const Vector2 &size)
Sets size of UI.
Definition
UIElement.cpp:8
UIElement::GetScreenPosition
Vector2 GetScreenPosition() const
Gets screen position of UI.
Definition
UIElement.cpp:13
UIElement::GetScreenSize
Vector2 GetScreenSize() const
Gets size of UI.
Definition
UIElement.cpp:5
UIElement::SetScreenPosition
void SetScreenPosition(const Vector2 &ScreenPosition)
Sets screen position of UI.
Definition
UIElement.cpp:16
UIElement::SetVisibility
void SetVisibility(bool visibility)
Sets visibility of UI.
Definition
UIElement.cpp:28
UIElement::isVisible
bool isVisible() const
Checks if UI is visible.
Definition
UIElement.cpp:25
Vector2
Standard 2-dimensional vector.
Definition
Vector2.hpp:11
Game
UI
UIElement.hpp
Generated by
1.17.0