|
ZeroZero Game Engine
v0.0
A 3D game engine using Vulkan & Jolt
|
A virtual UI Window displayed inside the rendering Window. All UI widgets must belong to a UI window.
Public Types | |
| enum | ResizeableBorder |
Public Member Functions | |
| Window (const Rect &rect) | |
| void | setResizeableBorders (const uint32_t borders) |
| uint32_t | getResizeableBorders () const |
| shared_ptr< Style > | getStyle () const |
| void | setStyle (const shared_ptr< Style > &style) |
| Widget & | getWidget () const |
| void | setWidget (shared_ptr< Widget > child=nullptr, const string &resources="", float padding=0) |
| template<typename T > | |
| auto | add (const shared_ptr< T > &child, const Widget::AlignmentType alignment, const string &resource="", const bool overlap=false) const |
| void | remove (const shared_ptr< Widget > &child) const |
| void | setFocusedWidget (const shared_ptr< Widget > &) |
| float | getWidth () const |
| float | getHeight () const |
| void | setRect (const Rect &newRect) |
| void | setWidth (float width) |
| void | setHeight (float height) |
| void | setPos (float x, float y) |
| void | setPos (vec2 pos) |
| void | setX (float x) |
| void | setY (float y) |
| const Rect & | getRect () const |
| bool | isVisible () const |
| void | setVisible (bool isVisible) |
| void | hide () |
| void | show () |
| void | setTransparency (float) |
| virtual void | onCreate () |
| virtual void | onDestroy () |
| virtual void | onShow () |
| virtual void | onHide () |
| virtual void | onResize () |
| virtual void | onMove () |
| virtual bool | onKeyDown (Key key) |
| virtual bool | onKeyUp (Key key) |
| virtual bool | onMouseDown (MouseButton button, float x, float y) |
| virtual bool | onMouseUp (MouseButton button, float x, float y) |
| virtual bool | onMouseMove (uint32_t buttonsState, float x, float y) |
| virtual void | onGotFocus () |
| virtual void | onLostFocus () |
| void | setMinimumSize (float width, float height) |
| void | setMaximumSize (float width, float height) |
| float | getMinimumWidth () const |
| float | getMinimumHeight () const |
| float | getMaximumWidth () const |
| float | getMaximumHeight () const |
| Font & | getDefaultFont () const |
Public Member Functions inherited from Object | |
| void | connect (const Signal::signal &name, const Signal::Handler &handler) |
| void | connect (const Signal::signal &name, const function< void ()> &handler) |
| void | emit (const Signal::signal &name, void *params=nullptr) |
| virtual string | toString () const |
| enum ResizeableBorder |
|
explicit |
Creates a virtual UI window with a given position & size
|
inline |
Adds a child widget. Children widgets will be destroyed on parent destruction.
| child | : child widget to add |
| alignment | : placement |
| resource | : resource string |
| overlap | : overlap widget on top of other widgets |
|
nodiscard |
Returns the default font loaded at startup
|
nodiscardinline |
Returns the height of the client area
|
nodiscardinline |
Returns the maximum height of the Window
|
nodiscardinline |
Returns the maximum width of the Window
|
nodiscardinline |
Returns the minimum height of the Window
|
nodiscardinline |
Returns the minimum width of the Window
|
nodiscardinline |
Returns the size & position of the widget
|
nodiscardinline |
Returns the borders that can be used to resize the Window
|
nodiscard |
Returns the current style layout or null
|
nodiscard |
|
nodiscardinline |
Returns the width of the client area
| void hide | ( | ) |
|
nodiscardinline |
Returns true if Window is currently visible
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Event called after a position change
|
inlinevirtual |
Event called after a size change
|
inlinevirtual |
|
inline |
Removes a child widget
| void setFocusedWidget | ( | const shared_ptr< Widget > & | ) |
Changes the focus
| void setHeight | ( | float | height | ) |
Sets the height of the client area
| void setMaximumSize | ( | float | width, |
| float | height | ||
| ) |
Sets the maximum size of the Window (default to VECTOR_SCALE)
| void setMinimumSize | ( | float | width, |
| float | height | ||
| ) |
Sets the minimum size of the Window (default to {2.0f, 2.0f})
| void setPos | ( | float | x, |
| float | y | ||
| ) |
Sets the position of the Window, bottom-left
| void setPos | ( | vec2 | pos | ) |
Sets the position of the Window, bottom-left
| void setRect | ( | const Rect & | newRect | ) |
Sets the client area position & size
|
inline |
Sets the borders that can be used to resize the Window
| void setStyle | ( | const shared_ptr< Style > & | style | ) |
Sets the current style layout. If null, installs a default layout
| void setTransparency | ( | float | ) |
Sets the alpha value for transparency
| void setVisible | ( | bool | isVisible | ) |
Sets the Window visibility. The change will be effective at the start of the next frame
| void setWidget | ( | shared_ptr< Widget > | child = nullptr, |
| const string & | resources = "", |
||
| float | padding = 0 |
||
| ) |
Sets the main widget with optional resource string. Call SetLayout(nullptr) if no layout have been set previously
| child | : child widget to add |
| resources | placement |
| padding | : new widget padding |
| void setWidth | ( | float | width | ) |
Sets the width of the client area
| void show | ( | ) |
Shows the Window. The change will be effective at the start of the next frame
1.7.0