TGUI
0.9.5
|
Backend that uses SFML. More...
#include <TGUI/Backends/SFML/BackendSFML.hpp>
Classes | |
struct | GuiResources |
Public Member Functions | |
void | attachGui (GuiBase *gui) override |
Informs the backend that a new gui object has been created. | |
void | detatchGui (GuiBase *gui) override |
Informs the backend that a gui object is being destroyed. | |
Font | createDefaultFont () override |
Creates and returns the default font for all widgets. | |
std::shared_ptr< BackendFontBase > | createFont () override |
Creates a new font object. | |
std::shared_ptr< BackendTextBase > | createText () override |
Creates a new text object. | |
std::shared_ptr< BackendTextureBase > | createTexture () override |
Creates a new texture object. | |
void | setMouseCursorStyle (Cursor::Type type, const std::uint8_t *pixels, Vector2u size, Vector2u hotspot) override |
Changes the look of a certain mouse cursor by using a bitmap. | |
void | resetMouseCursorStyle (Cursor::Type type) override |
Changes the look of a certain mouse cursor back to the system theme. | |
void | setMouseCursor (GuiBase *gui, Cursor::Type type) override |
Changes the mouse cursor when the mouse is on top of the window to which the gui is attached. | |
void | openVirtualKeyboard (const FloatRect &inputRect) override |
Opens the virtual keyboard on Android and iOS. | |
void | closeVirtualKeyboard () override |
Closes the virtual keyboard on Android and iOS. | |
bool | isKeyboardModifierPressed (Event::KeyModifier modifierKey) override |
Checks the state for one of the modifier keys. | |
void | setClipboard (const String &contents) override |
Changes the contents of the clipboard. | |
String | getClipboard () const override |
Returns the contents of the clipboard. | |
std::shared_ptr< BackendRenderTargetSFML > | createGuiRenderTarget (GuiSFML *gui, sf::RenderTarget &target) |
Sets the SFML target to which the gui will render and returns a new render target object to interact with. | |
Public Member Functions inherited from tgui::BackendBase | |
BackendBase ()=default | |
Default constructor. | |
BackendBase (const BackendBase &)=delete | |
BackendBase & | operator= (const BackendBase &)=delete |
virtual | ~BackendBase ()=default |
Virtual destructor. | |
void | setDestroyOnLastGuiDetatch (bool destroyOnDetatch) |
Informs the backend whether it should destroy itself when the last Gui is detached from it. | |
virtual std::unique_ptr< std::uint8_t[]> | readFileFromAndroidAssets (const String &filename, std::size_t &fileSize) const |
Uses the AssetManager on Android to read a file and return its contents. | |
Static Public Member Functions | |
static bool | convertEvent (const sf::Event &eventSFML, Event &eventTGUI) |
Helper function that converts an SFML event to a TGUI event. | |
Protected Member Functions | |
std::unique_ptr< sf::Cursor > | createSystemCursor (Cursor::Type type) |
void | updateMouseCursor (Cursor::Type type, std::unique_ptr< sf::Cursor > cursor) |
void | updateMouseCursor (sf::Window *window, Cursor::Type type) |
Protected Attributes | |
std::map< GuiBase *, GuiResources > | m_guis |
std::map< Cursor::Type, std::unique_ptr< sf::Cursor > > | m_mouseCursors |
Protected Attributes inherited from tgui::BackendBase | |
bool | m_destroyOnLastGuiDetatch = false |
String | m_clipboardContents |
Backend that uses SFML.
|
overridevirtual |
Informs the backend that a new gui object has been created.
gui | Newly created gui |
Implements tgui::BackendBase.
|
overridevirtual |
Closes the virtual keyboard on Android and iOS.
Implements tgui::BackendBase.
|
static |
Helper function that converts an SFML event to a TGUI event.
eventSFML | The input SFML event |
eventTGUI | The output TGUI event |
|
overridevirtual |
Creates and returns the default font for all widgets.
Implements tgui::BackendBase.
|
overridevirtual |
Creates a new font object.
Implements tgui::BackendBase.
std::shared_ptr< BackendRenderTargetSFML > tgui::BackendSFML::createGuiRenderTarget | ( | GuiSFML * | gui, |
sf::RenderTarget & | target | ||
) |
Sets the SFML target to which the gui will render and returns a new render target object to interact with.
gui | The gui for which the render target should be created |
target | SFML render target to draw on |
|
overridevirtual |
Creates a new text object.
Implements tgui::BackendBase.
|
overridevirtual |
Creates a new texture object.
Implements tgui::BackendBase.
|
overridevirtual |
Informs the backend that a gui object is being destroyed.
gui | Gui object that is about to be deconstructed |
Implements tgui::BackendBase.
|
overridevirtual |
Returns the contents of the clipboard.
Reimplemented from tgui::BackendBase.
|
overridevirtual |
Checks the state for one of the modifier keys.
modifierKey | The modifier key of which the state is being queried |
Implements tgui::BackendBase.
|
overridevirtual |
Opens the virtual keyboard on Android and iOS.
inputRect | Part of the screen where the text input is located |
Implements tgui::BackendBase.
|
overridevirtual |
Changes the look of a certain mouse cursor back to the system theme.
type | Cursor that should no longer use a custom bitmap |
Implements tgui::BackendBase.
|
overridevirtual |
Changes the contents of the clipboard.
contents | New contents of the clipboard |
Reimplemented from tgui::BackendBase.
|
overridevirtual |
Changes the mouse cursor when the mouse is on top of the window to which the gui is attached.
gui | The gui that represents the window for which the mouse cursor should be changed |
type | Which cursor to use |
Implements tgui::BackendBase.
|
overridevirtual |
Changes the look of a certain mouse cursor by using a bitmap.
type | Cursor that should make use of the bitmap |
pixels | Pointer to an array with 4*size.x*size.y elements, representing the pixels in 32-bit RGBA format |
size | Size of the cursor |
hotspot | Pixel coordinate within the cursor image which will be located exactly at the mouse pointer position |
Implements tgui::BackendBase.