MochiEngine
Loading...
Searching...
No Matches
Mochi::Graphics::GUIOptions Struct Reference

Options used by graphical GUI. This contains all the minimal data to show a sprite, including the path of the texture. Optional elements of the struct will be defaulted by the GUI implementation if not defined. More...

#include <GUICommon.hpp>

Public Attributes

std::string TexturePath
 Path or unique identifier of the texture in the catalog.
std::optional< RectfParentRect
 The space occupied by the GUI element that you want to contain this element. This is useful for putting a text in the center of a button, for example.
std::optional< RectfSrcRect
 Source rect in the used texture, in case it contains more than one sprite.
std::optional< RectfDstRect
 Destination rect, or where the GUI element will be placed according to the anchor and pivot.
std::optional< RectfSlice
 9-slice option to be able to make the sprite bigger than the texture without losing quality.
Vector2f ScreenAnchor
 Where the origin (0,0) will be when deciding where to place the sprite. Goes from -1,-1 to 1,1.
Vector2f SpritePivot
 Defines the pivot, which will act as the origin of the sprite when placing it in the screen. Goes from -1,-1 to 1,1.
std::optional< Color > Color
 Color of the element. This is a blend with the original color of the texture.

Detailed Description

Options used by graphical GUI. This contains all the minimal data to show a sprite, including the path of the texture. Optional elements of the struct will be defaulted by the GUI implementation if not defined.


The documentation for this struct was generated from the following file: