Potato Engine
Loading...
Searching...
No Matches
UIElement.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "Util/Vector2.hpp"
5
12{
13public:
14 virtual ~UIElement() = default;
15
17 Vector2 GetScreenSize() const;
19 void SetScreenSize(const Vector2& size);
20
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
34private:
35 Vector2 ScreenSize;
36 Vector2 ScreenPosition;
37 bool Visible;
38
39};
Wrapper for elements that can be rendered on screen.
Definition UIElement.hpp:12
void AddScreenOffset(const Vector2 &offset)
Adds offset to UI position.
Definition UIElement.cpp:20
void SetScreenSize(const Vector2 &size)
Sets size of UI.
Definition UIElement.cpp:8
Vector2 GetScreenPosition() const
Gets screen position of UI.
Definition UIElement.cpp:13
Vector2 GetScreenSize() const
Gets size of UI.
Definition UIElement.cpp:5
void SetScreenPosition(const Vector2 &ScreenPosition)
Sets screen position of UI.
Definition UIElement.cpp:16
void SetVisibility(bool visibility)
Sets visibility of UI.
Definition UIElement.cpp:28
bool isVisible() const
Checks if UI is visible.
Definition UIElement.cpp:25
Standard 2-dimensional vector.
Definition Vector2.hpp:11