Handle rendering for the gui.
More...
#include <GuiRender.h>
|
| void | setResources (sf::Texture &sprite) |
| | Set resources used in render. It should be called before any draw call.
|
| void | updateView (const sf::View &newView) |
| | Update view on which the gui is drawn.
|
| uint32_t | setCurrentClippingLayer (const sf::FloatRect &mask) |
| | Set current clipping layer used to render UI. Every call will create a new layer with its own independent meshes and return its id.
|
| void | setTextureAtlas (const TextureAtlas &atlas) |
| | Set texture atlas used in render. It should be called before any draw call.
|
| void | clear () |
| | Clear all widgets and text.
|
| void | draw (const sf::FloatRect &box, const WidgetDrawOptions &options={}) |
| | interface to draw Gui standard element
|
| void | draw (const std::string &text, const sf::Font &font, const TextDrawOptions &options={}) |
| | interface to draw Gui text using utf8
|
| sf::Vector2f | textSize (const std::string &text, const sf::Font &font, const uint32_t fontSize) const |
| | Get text size as if it was drawn on screen.
|
| void | setTooltipMode () |
| | set specific render for tooltip
|
| void | unsetTooltipMode () |
| | unset specific render for tooltip
|
| sf::Vector2f | textureSize (const std::string &texture) const |
| | allow access to a texture size, as stored in the atlas
|
Handle rendering for the gui.
◆ clear()
| void sgui::GuiRender::clear |
( |
| ) |
|
Clear all widgets and text.
◆ draw() [1/2]
| void sgui::GuiRender::draw |
( |
const sf::FloatRect & | box, |
|
|
const WidgetDrawOptions & | options = {} ) |
interface to draw Gui standard element
- Parameters
-
| box | Rect of the widget to draw |
| options | Contains information about Widget type, orientation and state |
◆ draw() [2/2]
| void sgui::GuiRender::draw |
( |
const std::string & | text, |
|
|
const sf::Font & | font, |
|
|
const TextDrawOptions & | options = {} ) |
interface to draw Gui text using utf8
- Parameters
-
| text | Text to display |
| font | Font used to display text |
| options | Contains font size, color and positions of text |
◆ setCurrentClippingLayer()
| uint32_t sgui::GuiRender::setCurrentClippingLayer |
( |
const sf::FloatRect & | mask | ) |
|
Set current clipping layer used to render UI. Every call will create a new layer with its own independent meshes and return its id.
- Returns
- Index of the current clipping layer
◆ setResources()
| void sgui::GuiRender::setResources |
( |
sf::Texture & | sprite | ) |
|
Set resources used in render. It should be called before any draw call.
- Parameters
-
◆ setTextureAtlas()
| void sgui::GuiRender::setTextureAtlas |
( |
const TextureAtlas & | atlas | ) |
|
Set texture atlas used in render. It should be called before any draw call.
- Parameters
-
◆ setTooltipMode()
| void sgui::GuiRender::setTooltipMode |
( |
| ) |
|
set specific render for tooltip
◆ textSize()
| sf::Vector2f sgui::GuiRender::textSize |
( |
const std::string & | text, |
|
|
const sf::Font & | font, |
|
|
const uint32_t | fontSize ) const |
Get text size as if it was drawn on screen.
- Parameters
-
| text | Text from which we want the size |
| font | Font of the text |
| fontSize | Size of the text font |
- Returns
- Size of the text as it would be displayed
◆ textureSize()
| sf::Vector2f sgui::GuiRender::textureSize |
( |
const std::string & | texture | ) |
const |
allow access to a texture size, as stored in the atlas
- Parameters
-
| texture | Key to access texture |
- Returns
- Texture size in the sprite sheet
◆ unsetTooltipMode()
| void sgui::GuiRender::unsetTooltipMode |
( |
| ) |
|
unset specific render for tooltip
◆ updateView()
| void sgui::GuiRender::updateView |
( |
const sf::View & | newView | ) |
|
Update view on which the gui is drawn.
◆ clipping
to handle clipping layers
The documentation for this class was generated from the following files: