Potato Engine
Loading...
Searching...
No Matches
UIElement Class Reference

Wrapper for elements that can be rendered on screen. More...

#include <UIElement.hpp>

Inheritance diagram for UIElement:
Widget WidgetElement DebugInfo TextElement

Public Member Functions

Vector2 GetScreenSize () const
 Gets size of UI.
void SetScreenSize (const Vector2 &size)
 Sets size of UI.
Vector2 GetScreenPosition () const
 Gets screen position of UI.
void SetScreenPosition (const Vector2 &ScreenPosition)
 Sets screen position of UI.
void AddScreenOffset (const Vector2 &offset)
 Adds offset to UI position.
bool isVisible () const
 Checks if UI is visible.
void SetVisibility (bool visibility)
 Sets visibility of UI.

Detailed Description

Wrapper for elements that can be rendered on screen.

Used for scaling size, position, offsets, and visibility parameters across different types of UI targets

Definition at line 11 of file UIElement.hpp.

Member Function Documentation

◆ GetScreenSize()

Vector2 UIElement::GetScreenSize ( ) const

Gets size of UI.

Returns
Vector with x and y size components

Definition at line 5 of file UIElement.cpp.

◆ SetScreenSize()

void UIElement::SetScreenSize ( const Vector2 & size)

Sets size of UI.

Parameters
sizeVector with x and y size components

Definition at line 8 of file UIElement.cpp.

◆ GetScreenPosition()

Vector2 UIElement::GetScreenPosition ( ) const

Gets screen position of UI.

Returns
Vector with x and y screen positions

Definition at line 13 of file UIElement.cpp.

◆ SetScreenPosition()

void UIElement::SetScreenPosition ( const Vector2 & ScreenPosition)

Sets screen position of UI.

Parameters
ScreenPositionvector with x and y screen positions

Definition at line 16 of file UIElement.cpp.

◆ AddScreenOffset()

void UIElement::AddScreenOffset ( const Vector2 & offset)

Adds offset to UI position.

Parameters
offsetVector with offset direction

Definition at line 20 of file UIElement.cpp.

◆ isVisible()

bool UIElement::isVisible ( ) const

Checks if UI is visible.

Returns
true if visible

Definition at line 25 of file UIElement.cpp.

◆ SetVisibility()

void UIElement::SetVisibility ( bool visibility)

Sets visibility of UI.

Parameters
visibilityVisibility to set

Definition at line 28 of file UIElement.cpp.