TGUI  1.6.1
Loading...
Searching...
No Matches
tgui Namespace Reference

Namespace that contains all TGUI functions and classes. More...

Classes

class  AbsoluteOrRelativeValue
 Class to store the a value that is either a constant or a ratio. More...
 
class  Backend
 Base class for the backend. More...
 
class  BackendFont
 Base class for font implementations that depend on the backend. More...
 
class  BackendFontFactory
 Base class for the font factory that is responsible for creating a font object specific to the font backend. More...
 
class  BackendFontFactoryImpl
 Class that creates font objects of a given type. More...
 
class  BackendFontFreetype
 Font implementations that uses FreeType directly to load glyphs. More...
 
class  BackendFontRaylib
 Font implementations that uses Raylib to load glyphs. More...
 
class  BackendFontSDLttf
 Font implementations that uses SDL_ttf to load glyphs. More...
 
class  BackendFontSFML
 Font implementation that makes use of SFML. More...
 
class  BackendGLFW
 
class  BackendGui
 Base class for the Gui. More...
 
class  BackendGuiGLFW
 
class  BackendGuiRaylib
 
class  BackendGuiSDL
 
class  BackendGuiSFML
 
class  BackendRaylib
 
class  BackendRenderer
 Base class for the backend renderer, which is responsible for creating text and texture objects. More...
 
class  BackendRendererGLES2
 Backend renderer that uses OpenGL ES 2 or 3 (depending on the loaded OpenGL ES context that you have to provide) More...
 
class  BackendRendererOpenGL3
 Backend renderer that uses OpenGL 3 or 4 (depending on the loaded OpenGL context that you have to provide) More...
 
class  BackendRendererRaylib
 Backend renderer that uses raylib. More...
 
class  BackendRendererSDL
 Backend renderer that uses SDL_Renderer. More...
 
class  BackendRendererSFML
 Backend renderer that uses sfml-graphics. More...
 
class  BackendRenderTarget
 Base class for render targets. More...
 
class  BackendRenderTargetGLES2
 Render target implementation that makes use of OpenGL ES. More...
 
class  BackendRenderTargetOpenGL3
 Render target implementation that makes use of modern OpenGL. More...
 
class  BackendRenderTargetRaylib
 Render target implementation that makes use of raylib. More...
 
class  BackendRenderTargetSDL
 Render target implementation that makes use of SDL_Renderer. More...
 
class  BackendRenderTargetSFML
 Render target that uses SFML to draw the gui. More...
 
class  BackendSDL
 
class  BackendSFML
 
class  BackendText
 Base class for text implementations that depend on the backend. More...
 
class  BackendTexture
 Base class for texture implementations that depend on the backend. More...
 
class  BackendTextureGLES2
 Texture implementation that makes use of modern OpenGL ES. More...
 
class  BackendTextureOpenGL3
 Texture implementation that makes use of modern OpenGL. More...
 
class  BackendTextureRaylib
 Texture implementation that makes use of raylib. More...
 
class  BackendTextureSDL
 Texture implementation that makes use of SDL_Texture. More...
 
class  BackendTextureSFML
 Texture implementation that makes use of SFML. More...
 
class  BaseThemeLoader
 Base class for theme loader implementations. More...
 
class  BitmapButton
 Button widget with an image displayed next to the text (or centered in the button without text) More...
 
class  BoxLayout
 Abstract class for box layout containers. More...
 
class  BoxLayoutRatios
 Abstract class for box layout containers. More...
 
class  BoxLayoutRenderer
 
class  Button
 Button widget. More...
 
class  ButtonBase
 Base class for button widgets. More...
 
class  ButtonRenderer
 
class  CanvasBase
 This class is used as base class for the backend-specific canvas widgets. More...
 
class  CanvasGLES2
 CanvasGLES2 provides a way to directly render OpenGL ES contents on a widget. More...
 
class  CanvasOpenGL3
 CanvasOpenGL3 provides a way to directly render OpenGL contents on a widget. More...
 
class  CanvasRaylib
 CanvasRaylib provides a way to directly render raylib contents on a widget. More...
 
class  CanvasSDL
 CanvasSDL provides a way to directly render SDL contents on a widget. More...
 
class  CanvasSFML
 CanvasSFML provides a way to directly render SFML contents on a widget. More...
 
class  ChatBox
 
class  ChatBoxRenderer
 
class  CheckBox
 CheckBox widget. More...
 
class  CheckBoxRenderer
 
class  ChildWindow
 Child window widget. More...
 
class  ChildWindowRenderer
 
class  ClickableWidget
 Clickable widget. More...
 
class  Color
 Wrapper for colors. More...
 
class  ColorPicker
 Color picker widget. More...
 
class  ColorPickerRenderer
 
class  ComboBox
 Combo box widget. More...
 
class  ComboBoxRenderer
 
class  Container
 Container widget. More...
 
class  CopiedSharedPtr
 
class  Cursor
 Class that allows the cursor to be changed. More...
 
class  CustomWidgetForBindings
 Class used by bindings to implement custom widgets withing these bindings (e.g. a custom C# widget in TGUI.Net) More...
 
class  DataIO
 Parser and emitter for widget files.
 
class  DefaultBackendWindow
 This class abstracts the backend-specific window and gui creation code. More...
 
class  DefaultThemeLoader
 Default implementation for theme loading. More...
 
class  Deserializer
 Deserializes a settable property. More...
 
class  DualScrollbarChildInterface
 Base class for widgets with both a vertical and horizontal scrollbar. More...
 
class  Duration
 Wrapper for durations. More...
 
class  EditBox
 Edit box widget. More...
 
class  EditBoxRenderer
 
class  EditBoxSlider
 Edit box slider widget. More...
 
struct  Event
 
class  Exception
 
class  FileDialog
 File dialog widget. More...
 
class  FileDialogIconLoader
 
class  FileDialogRenderer
 
class  Filesystem
 Helper functionality for filesystem access. More...
 
class  Font
 Wrapper around the backend-specific font. All copies of the font will share the same internal font resource. More...
 
struct  FontGlyph
 Information about a glyph in the font. More...
 
class  Grid
 
class  Group
 Group widget. More...
 
class  GroupRenderer
 
class  Gui
 Gui class for GLFW + GLES2 backend (using FreeType for fonts) More...
 
class  HorizontalLayout
 Container that automatically resizes children to fit the entire available space between children. More...
 
class  HorizontalWrap
 Container that automatically arranges children in lines, adding a new line when a horizontal line is full. More...
 
struct  ImageLoader
 Class that is internally used to load an image from a file or from memory. More...
 
class  Knob
 Knob widget. More...
 
class  KnobRenderer
 
class  Label
 Label widget. More...
 
class  LabelRenderer
 
class  Layout
 Class to store the left, top, width or height of a widget. More...
 
class  Layout2d
 Class to store the position or size of a widget. More...
 
class  ListBox
 List box widget. More...
 
class  ListBoxRenderer
 
class  ListView
 List view widget. More...
 
class  ListViewRenderer
 
class  MenuBar
 Menu bar widget. More...
 
class  MenuBarMenuPlaceholder
 Widget that is added to a container when the user clicks on the menu bar. This widget will be added in front of all other widgets to ensure that the menus from the menu bar are always drawn in front of other widgets. More...
 
class  MenuBarRenderer
 Renderer for the MenuBar widget. More...
 
class  MessageBox
 Message box widget. More...
 
class  MessageBoxRenderer
 
class  ObjectConverter
 Implicit converter for settable properties. More...
 
class  Outline
 
class  Panel
 Group of widgets that has a background color and optional borders. More...
 
class  PanelListBox
 List of panels, which can be flexible changed. More...
 
class  PanelListBoxRenderer
 
class  PanelRenderer
 
class  Picture
 Picture widget. More...
 
class  PictureRenderer
 
class  ProgressBar
 Progress bar widget. More...
 
class  ProgressBarRenderer
 
class  RadioButton
 Radio button widget. More...
 
class  RadioButtonGroup
 Can be used as parent of radio buttons so that different groups of radio buttons can be isolated. More...
 
class  RadioButtonRenderer
 
class  RangeSlider
 RangeSlider widget. More...
 
class  RangeSliderRenderer
 
class  Rect
 
struct  RelativeValue
 Helper class to create an AbsoluteOrRelativeValue object containing a relative value without using a string. More...
 
struct  RelFloatRect
 FloatRect that can contain absolute values or values relative to the parent size. More...
 
struct  RendererData
 Shared data used in renderer classes. More...
 
struct  RenderStates
 States used for drawing. More...
 
class  RichTextLabel
 RichTextLabel widget. More...
 
class  RootContainer
 
class  ScrollablePanel
 Group of widgets that has a background color and optional borders. More...
 
class  ScrollablePanelRenderer
 
class  Scrollbar
 Scrollbar widget. More...
 
class  ScrollbarAccessor
 Class returned by widgets that have a scrollbar to let the user access scrollbar properties. More...
 
class  ScrollbarChildInterface
 Base class for widgets with a single scrollbar. More...
 
class  ScrollbarChildWidget
 Wrapper around scrollbar to be used inside widgets that need a scrollbar. More...
 
class  ScrollbarRenderer
 
class  SeparatorLine
 Widget that is drawn as a filled rectangle and can be used as a line to visually separate widgets from each other. More...
 
class  SeparatorLineRenderer
 
class  Serializer
 Serializes an settable property. More...
 
class  Signal
 Signal to which the user can subscribe to get callbacks from. More...
 
class  SignalAnimationType
 Signal to which the user can subscribe to get callbacks from. More...
 
class  SignalChildWindow
 Signal to which the user can subscribe to get callbacks from. More...
 
class  SignalFileDialogPaths
 Signal to which the user can subscribe to get callbacks from. More...
 
class  SignalItem
 Signal to which the user can subscribe to get callbacks from. More...
 
class  SignalItemHierarchy
 Signal to which the user can subscribe to get callbacks from. More...
 
class  SignalManager
 
class  SignalPanelListBoxItem
 Signal to which the user can subscribe to get callbacks from. More...
 
class  SignalShowEffect
 Signal to which the user can subscribe to get callbacks from. More...
 
class  SignalTyped
 Signal to which the user can subscribe to get callbacks from. More...
 
class  SignalTyped2
 Signal to which the user can subscribe to get callbacks from. More...
 
class  Slider
 Slider widget. More...
 
class  SliderRenderer
 
class  SpinButton
 Spin button widget. More...
 
class  SpinButtonRenderer
 
class  SpinControl
 Spin control widget. More...
 
class  SplitContainer
 Container that should contains exactly 2 child widgets which will be resized to fill the container together, with a splitter between them that can be dragged to change the amount of space each widget takes up. More...
 
class  SplitContainerRenderer
 
class  Sprite
 
class  String
 Wrapper class to store strings. More...
 
class  SubwidgetContainer
 Base class for widgets that consist of subwidgets that act together as if they are a single widget. More...
 
class  SvgImage
 
class  TabContainer
 TabContainer widget. More...
 
class  Tabs
 Tabs widget. More...
 
class  TabsRenderer
 
class  Text
 Backend-independent wrapper around the backend-specific text class. More...
 
class  TextArea
 Text area widget. More...
 
class  TextAreaRenderer
 
class  TextStyles
 Wrapper for text styles. More...
 
class  Texture
 Texture wrapper that internally reuses resources when multiple Texture objects are loaded from the same file. More...
 
struct  TextureData
 
struct  TextureDataHolder
 
class  TextureManager
 
class  Theme
 This class can be used to manage the widget renderers. More...
 
class  Timer
 Executes callbacks after a certain amount of time. More...
 
class  ToggleButton
 ToggleButton widget. More...
 
class  ToolTip
 Interface to set the settings for the tool tips. More...
 
class  Transform
 Defines a transform matrix. More...
 
class  TreeView
 Tree view widget. More...
 
class  TreeViewRenderer
 
class  TwoFingerScrollDetect
 
class  Variant
 
class  Vector2
 
struct  Vertex
 
class  VerticalLayout
 Container that automatically resizes children to fit the entire available space between children. More...
 
class  Widget
 The parent class for every widget. More...
 
class  WidgetFactory
 
class  WidgetRenderer
 Base class for all renderer classes. More...
 
class  WindowsIMM
 Dynamically loads and uses imm32.dll on Windows to control the IME. More...
 

Typedefs

using Any = std::any
 
template<typename T >
using Optional = std::optional<T>
 
using Borders = Outline
 
using Padding = Outline
 
using FloatRect = Rect<float>
 
using IntRect = Rect<int>
 
using UIntRect = Rect<unsigned int>
 
using SignalInt = SignalTyped<int>
 Signal with one "int" as optional unbound parameter.
 
using SignalUInt = SignalTyped<unsigned int>
 Signal with one "unsigned int" as optional unbound parameter.
 
using SignalBool = SignalTyped<bool>
 Signal with one "bool" as optional unbound parameter.
 
using SignalFloat = SignalTyped<float>
 Signal with one "float" as optional unbound parameter.
 
using SignalColor = SignalTyped<Color>
 Signal with one "Color" as optional unbound parameter.
 
using SignalString = SignalTyped<const String&>
 Signal with one "String" as optional unbound parameter.
 
using SignalVector2f = SignalTyped<Vector2f>
 Signal with one "Vector2f" as optional unbound parameter.
 
using SignalFloatRect = SignalTyped<FloatRect>
 Signal with one "FloatRect" as optional unbound parameter.
 
using SignalRange = SignalTyped2<float, float>
 Signal with two floats as optional unbound parameters.
 
using StringView = std::u32string_view
 
using CharStringView = std::string_view
 
using Vector2f = Vector2<float>
 
using Vector2u = Vector2<unsigned int>
 
using Vector2i = Vector2<int>
 
using ToggleButtonRenderer = ButtonRenderer
 
using BitmapButtonRenderer = ButtonRenderer
 
using TextBoxRenderer = TextAreaRenderer
 

Enumerations

enum class  ShowEffectType {
  Fade , Scale , SlideToRight , SlideToLeft ,
  SlideToBottom , SlideToTop , SlideFromLeft = SlideToRight , SlideFromRight = SlideToLeft ,
  SlideFromTop = SlideToBottom , SlideFromBottom = SlideToTop
}
 Type of effect to show/hide widget. More...
 
enum class  AnimationType { Move , Resize , Opacity }
 Type of animation. More...
 
enum class  Orientation { Vertical , Horizontal }
 Orientation of the object. More...
 
enum class  HorizontalAlignment { Left , Center , Right }
 The horizontal alignment. More...
 
enum class  VerticalAlignment { Top , Center , Bottom }
 The vertical alignment. More...
 
enum class  AutoLayout {
  Manual , Top , Left , Right ,
  Bottom , Leftmost , Rightmost , Fill
}
 Alignments for how to position a widget in its parent. More...
 
enum  TextStyle : unsigned int {
  Regular = 0 , Bold = 1 << 0 , Italic = 1 << 1 , Underlined = 1 << 2 ,
  StrikeThrough = 1 << 3
}
 Enumeration of the text drawing styles. More...
 

Functions

template<typename T >
AnyCast (const Any &obj)
 
TGUI_API std::string base64Encode (const std::uint8_t *data, std::size_t nrBytes)
 Encodes binary data to a base64 string.
 
TGUI_API std::vector< std::uint8_t > base64Decode (CharStringView data)
 Decodes a base64 string to binary data.
 
constexpr bool operator== (const Duration &lhs, const Duration &rhs)
 
constexpr bool operator!= (const Duration &lhs, const Duration &rhs)
 
constexpr bool operator> (const Duration &lhs, const Duration &rhs)
 
constexpr bool operator>= (const Duration &lhs, const Duration &rhs)
 
constexpr bool operator< (const Duration &lhs, const Duration &rhs)
 
constexpr bool operator<= (const Duration &lhs, const Duration &rhs)
 
constexpr Duration operator+ (const Duration &lhs, const Duration &rhs)
 
constexpr Duration operator- (const Duration &lhs, const Duration &rhs)
 
template<typename T , typename = typename std::enable_if_t<std::is_arithmetic<T>::value, T>>
constexpr Duration operator* (const Duration &lhs, T rhs)
 
template<typename T , typename = typename std::enable_if_t<std::is_arithmetic<T>::value, T>>
constexpr Duration operator* (T lhs, const Duration &rhs)
 
template<typename T , typename = typename std::enable_if_t<std::is_arithmetic<T>::value, T>>
constexpr Duration operator/ (const Duration &lhs, T rhs)
 
constexpr float operator/ (const Duration &lhs, const Duration &rhs)
 
template<typename T , typename = typename std::enable_if_t<std::is_arithmetic<T>::value, T>>
constexpr Duration operator% (const Duration &lhs, T rhs)
 
constexpr Duration operator% (const Duration &lhs, const Duration &rhs)
 
constexpr Durationoperator+= (Duration &lhs, const Duration &rhs)
 
constexpr Durationoperator-= (Duration &lhs, const Duration &rhs)
 
template<typename T , typename = typename std::enable_if_t<std::is_arithmetic<T>::value, T>>
constexpr Durationoperator*= (Duration &lhs, T rhs)
 
template<typename T , typename = typename std::enable_if_t<std::is_arithmetic<T>::value, T>>
constexpr Durationoperator/= (Duration &lhs, T rhs)
 
template<typename T , typename = typename std::enable_if_t<std::is_arithmetic<T>::value, T>>
constexpr Durationoperator%= (Duration &lhs, T rhs)
 
constexpr Durationoperator%= (Duration &lhs, const Duration &rhs)
 
template<typename T >
std::unique_ptr< T > MakeUniqueForOverwrite (const std::size_t size)
 Create a unique_ptr containing an uninitialized array.
 
template<typename T >
constexpr const T & clamp (const T &v, const T &lo, const T &hi)
 Clamps a value between two boundries. This function exists because std::clamp was only added with c++17.
 
TGUI_API void setGlobalTextSize (unsigned int textSize)
 Sets the default text size for all widgets created after calling the function.
 
TGUI_API unsigned int getGlobalTextSize ()
 Retrieves the default text size used for all new widgets.
 
TGUI_API void setDoubleClickTime (Duration duration)
 Sets the double-click time for the mouse.
 
TGUI_API Duration getDoubleClickTime ()
 Retrieves the double-click time for the mouse.
 
TGUI_API void setResourcePath (const Filesystem::Path &path)
 Sets a new resource path.
 
TGUI_API void setResourcePath (const String &path)
 Sets a new resource path.
 
TGUI_API const Filesystem::PathgetResourcePath ()
 Returns the resource path.
 
TGUI_API void setEditCursorBlinkRate (Duration blinkRate)
 Changes the blink rate of the cursor in edit fields such as EditBox and TextArea.
 
TGUI_API Duration getEditCursorBlinkRate ()
 Returns the blink rate of the cursor in edit fields such as EditBox and TextArea.
 
TGUI_API std::unique_ptr< std::uint8_t[]> readFileToMemory (const String &filename, std::size_t &fileSize)
 Opens a file and reads its contents into memory.
 
TGUI_API bool writeFile (const String &filename, const std::stringstream &textToWrite)
 Opens a file and writes the given contents to it.
 
TGUI_API bool writeFile (const String &filename, CharStringView textToWrite)
 Opens a file and writes the given contents to it.
 
TGUI_API Layout operator- (Layout right)
 Unary minus operator for the Layout class.
 
TGUI_API Layout operator+ (Layout left, Layout right)
 
  • operator for the Layout class

 
TGUI_API Layout operator- (Layout left, Layout right)
 
  • operator for the Layout class

 
TGUI_API Layout operator* (Layout left, Layout right)
 
  • operator for the Layout class

 
TGUI_API Layout operator/ (Layout left, Layout right)
 / operator for the Layout class
 
TGUI_API Layout2d operator- (Layout2d right)
 Unary minus operator for the Layout2d class.
 
TGUI_API Layout2d operator+ (Layout2d left, Layout2d right)
 
 
TGUI_API Layout2d operator- (Layout2d left, Layout2d right)
 
 
TGUI_API Layout2d operator* (Layout2d left, const Layout &right)
 
 
TGUI_API Layout2d operator* (const Layout &left, Layout2d right)
 
 
TGUI_API Layout2d operator/ (Layout2d left, const Layout &right)
 / operator for the Layout2d class
 
TGUI_API Layout bindPosX (const std::shared_ptr< Widget > &widget)
 Bind to the x position of the widget (same as bindLeft unless widget origin is changed)
 
TGUI_API Layout bindPosY (const std::shared_ptr< Widget > &widget)
 Bind to the y position of the widget (same as bindTop unless widget origin is changed)
 
TGUI_API Layout bindLeft (const std::shared_ptr< Widget > &widget)
 Bind to the left position of the widget.
 
TGUI_API Layout bindTop (const std::shared_ptr< Widget > &widget)
 Bind to the top position of the widget.
 
TGUI_API Layout bindWidth (const std::shared_ptr< Widget > &widget)
 Bind to the width of the widget.
 
TGUI_API Layout bindHeight (const std::shared_ptr< Widget > &widget)
 Bind to the height of the widget.
 
TGUI_API Layout bindInnerWidth (const std::shared_ptr< Container > &container)
 Bind to the inner width of the container widget.
 
TGUI_API Layout bindInnerHeight (const std::shared_ptr< Container > &container)
 Bind to the inner height of the container widget.
 
TGUI_API Layout bindRight (const std::shared_ptr< Widget > &widget)
 Bind to the right position of the widget.
 
TGUI_API Layout bindBottom (const std::shared_ptr< Widget > &widget)
 Bind to the bottom of the widget.
 
TGUI_API Layout2d bindPosition (const std::shared_ptr< Widget > &widget)
 Bind to the position of the widget.
 
TGUI_API Layout2d bindSize (const std::shared_ptr< Widget > &widget)
 Bind to the size of the widget.
 
TGUI_API Layout2d bindInnerSize (const std::shared_ptr< Container > &container)
 Bind to the inner size of the container widget.
 
TGUI_API Layout bindWidth (const BackendGui &gui)
 Bind to the width of the gui view.
 
TGUI_API Layout bindHeight (const BackendGui &gui)
 Bind to the height of the gui view.
 
TGUI_API Layout2d bindSize (const BackendGui &gui)
 Bind to the size of the gui view.
 
TGUI_API Layout bindMin (const Layout &value1, const Layout &value2)
 Bind to the minimum value of two layouts.
 
TGUI_API Layout bindMax (const Layout &value1, const Layout &value2)
 Bind to the maximum value of two layouts.
 
template<typename T >
constexpr bool operator== (const Rect< T > &left, const Rect< T > &right)
 Checks if two Rect objects are equal.
 
template<typename T >
constexpr bool operator!= (const Rect< T > &left, const Rect< T > &right)
 Checks if two Rect objects are different.
 
TGUI_API bool isWhitespace (char character)
 Checks if a character is a whitespace character (e.g. space, tab, carriage return, line feed, ...)
 
TGUI_API bool isWhitespace (char32_t character)
 Checks if a character is a whitespace character (e.g. space, tab, carriage return, line feed, ...)
 
TGUI_API bool isAlpha (char32_t character)
 Checks whether a character is an alphabetic character.
 
TGUI_API bool isDigit (char32_t character)
 Checks whether a character is digit (only 0 to 9 are considered digits, no unicode characters are)
 
bool operator== (const String &left, StringView right)
 
bool operator== (const String &left, const char32_t *right)
 
bool operator== (const String &left, const std::u32string &right)
 
bool operator== (const String &left, const String &right)
 
bool operator!= (const String &left, StringView right)
 
bool operator!= (const String &left, const char32_t *right)
 
bool operator!= (const String &left, const std::u32string &right)
 
bool operator!= (const String &left, const String &right)
 
bool operator< (const String &left, StringView right)
 
bool operator< (const String &left, const char32_t *right)
 
bool operator< (const String &left, const std::u32string &right)
 
bool operator< (const String &left, const String &right)
 
bool operator<= (const String &left, StringView right)
 
bool operator<= (const String &left, const char32_t *right)
 
bool operator<= (const String &left, const std::u32string &right)
 
bool operator<= (const String &left, const String &right)
 
bool operator> (const String &left, StringView right)
 
bool operator> (const String &left, const char32_t *right)
 
bool operator> (const String &left, const std::u32string &right)
 
bool operator> (const String &left, const String &right)
 
bool operator>= (const String &left, StringView right)
 
bool operator>= (const String &left, const char32_t *right)
 
bool operator>= (const String &left, const std::u32string &right)
 
bool operator>= (const String &left, const String &right)
 
String operator+ (const String &left, const String &right)
 
String operator+ (String &&left, String &&right)
 
String operator+ (String &&left, const String &right)
 
String operator+ (const String &left, String &&right)
 
TGUI_API std::ostream & operator<< (std::ostream &os, const String &str)
 
TGUI_API std::wostream & operator<< (std::wostream &os, const String &str)
 
TGUI_API std::istream & operator>> (std::istream &os, String &str)
 
TGUI_API std::wistream & operator>> (std::wistream &os, String &str)
 
bool viewEqualIgnoreCase (CharStringView view1, CharStringView view2)
 Returns whether two view are equal if letters would have been lowercase.
 
bool viewEqualIgnoreCase (StringView view1, StringView view2)
 Returns whether two view are equal if ASCII letters would have been lowercase.
 
bool viewStartsWith (CharStringView viewToLookInto, CharStringView viewToLookFor)
 Checks whether the view starts with the given substring.
 
bool viewStartsWith (CharStringView viewToLookInto, char charToLookFor)
 Checks whether the view starts with the given character.
 
bool viewEndsWith (CharStringView viewToLookInto, CharStringView viewToLookFor)
 Checks whether the view ends with the given substring.
 
bool viewEndsWith (CharStringView viewToLookInto, char charToLookFor)
 Checks whether the view ends with the given character.
 
bool viewStartsWith (StringView viewToLookInto, StringView viewToLookFor)
 Checks whether the view starts with the given substring.
 
bool viewStartsWith (StringView viewToLookInto, char32_t charToLookFor)
 Checks whether the view starts with the given character.
 
bool viewEndsWith (StringView viewToLookInto, StringView viewToLookFor)
 Checks whether the view ends with the given substring.
 
bool viewEndsWith (StringView viewToLookInto, char32_t charToLookFor)
 Checks whether the view ends with the given character.
 
template<typename T >
constexpr Vector2< T > operator- (const Vector2< T > &right)
 Overload of unary operator -.
 
template<typename T >
constexpr Vector2< T > & operator+= (Vector2< T > &left, const Vector2< T > &right)
 Overload of binary operator +=.
 
template<typename T >
constexpr Vector2< T > & operator-= (Vector2< T > &left, const Vector2< T > &right)
 Overload of binary operator -=.
 
template<typename T >
constexpr Vector2< T > operator+ (const Vector2< T > &left, const Vector2< T > &right)
 Overload of binary operator +.
 
template<typename T >
constexpr Vector2< T > operator- (const Vector2< T > &left, const Vector2< T > &right)
 Overload of binary operator -.
 
template<typename T >
constexpr Vector2< T > operator* (const Vector2< T > &left, float right)
 Overload of binary operator *.
 
template<typename T >
constexpr Vector2< T > operator* (float left, const Vector2< T > &right)
 Overload of binary operator *.
 
template<typename T >
constexpr Vector2< T > & operator*= (Vector2< T > &left, float right)
 Overload of binary operator *=.
 
template<typename T >
constexpr Vector2< T > operator/ (const Vector2< T > &left, float right)
 Overload of binary operator /.
 
template<typename T >
constexpr Vector2< T > & operator/= (Vector2< T > &left, float right)
 Overload of binary operator /=.
 
template<typename T >
constexpr bool operator== (const Vector2< T > &left, const Vector2< T > &right)
 Overload of binary operator ==.
 
template<typename T >
constexpr bool operator!= (const Vector2< T > &left, const Vector2< T > &right)
 Overload of binary operator !=.
 
TGUI_API bool isBackendSet ()
 Checks whether the backend differs from a nullptr.
 
TGUI_API void setBackend (std::shared_ptr< Backend > backend)
 Changes the global backend.
 
TGUI_API std::shared_ptr< BackendgetBackend ()
 Returns the global backend.
 

Variables

constexpr unsigned int AutoTextSize = 0xFFFFFFFF
 

Detailed Description

Namespace that contains all TGUI functions and classes.

Enumeration Type Documentation

◆ AnimationType

enum class tgui::AnimationType
strong

Type of animation.

Enumerator
Move 

Position is being changed.

Resize 

Size is being changed.

Opacity 

Opacity is being changed.

◆ AutoLayout

enum class tgui::AutoLayout
strong

Alignments for how to position a widget in its parent.

Since
TGUI 1.1
Enumerator
Manual 

Position and size need to be manually set. This is the default.

Top 

Places the widget on on the top and sets its width to the area between Leftmost and Rightmost aligned components. Height needs to be manually set.

Left 

Places the widget on the left side and sets its height to the area between Top and Bottom aligned components. Width needs to be manually set.

Right 

Places the widget on the right side and sets its height to the area between Top and Bottom aligned components. Width needs to be manually set.

Bottom 

Places the widget on on the bottom and sets its width to the area between Leftmost and Rightmost aligned components. Height needs to be manually set.

Leftmost 

Places the widget on the left side and sets height to 100%. Width needs to be manually set. Same as Left alignment if no widget uses Top or Bottom alignment.

Rightmost 

Places the widget on the right side and sets height to 100%. Width needs to be manually set. Same as Left alignment if no widget uses Top or Bottom alignment.

Fill 

Sets the position and size to fill the entire area that isn't already taken by components with the other AutoLayout values.

◆ HorizontalAlignment

enum class tgui::HorizontalAlignment
strong

The horizontal alignment.

Since
TGUI 1.3
Enumerator
Left 

Align to the left side.

Center 

Center the object horizontally.

Right 

Align to the right side.

◆ Orientation

enum class tgui::Orientation
strong

Orientation of the object.

Since
TGUI 1.4
Enumerator
Vertical 

Vertical orientation.

Horizontal 

Horizontal orientation.

◆ ShowEffectType

enum class tgui::ShowEffectType
strong

Type of effect to show/hide widget.

Enumerator
Fade 

Fade widget in or out.

Scale 

Shrink to the center of the widget to hide or grow from its center to show.

SlideToRight 

Slide to the right to hide or from left to show.

SlideToLeft 

Slide to the left to hide or from right to show.

SlideToBottom 

Slide to the bottom to hide or from top to show.

SlideToTop 

Slide to the top to hide or from bottom to show.

SlideFromLeft 

Slide from left to show or to the right to hide.

SlideFromRight 

Slide from right to show or to the left to hide.

SlideFromTop 

Slide from top to show or to the bottom to hide.

SlideFromBottom 

Slide from bottom to show or to the top to hide.

◆ TextStyle

enum tgui::TextStyle : unsigned int

Enumeration of the text drawing styles.

Enumerator
Regular 

Regular characters, no style.

Bold 

Bold characters.

Italic 

Italic characters.

Underlined 

Underlined characters.

StrikeThrough 

Strike through characters.

◆ VerticalAlignment

enum class tgui::VerticalAlignment
strong

The vertical alignment.

Since
TGUI 1.3
Enumerator
Top 

Align to the top.

Center 

Center the object vertically.

Bottom 

Align to the bottom.

Function Documentation

◆ base64Decode()

TGUI_API std::vector< std::uint8_t > tgui::base64Decode ( CharStringView data)
nodiscard

Decodes a base64 string to binary data.

Parameters
dataView on the base64 string
Returns
Binary data contained in the base64-encoded string

◆ base64Encode()

TGUI_API std::string tgui::base64Encode ( const std::uint8_t * data,
std::size_t nrBytes )
nodiscard

Encodes binary data to a base64 string.

Parameters
dataPointer to the start of the binary data
nrBytesLength of the binary data in bytes
Returns
String with base64-encoded data. The string is padded with '=' at the end if needed, and contains no prefix.

◆ getBackend()

TGUI_API std::shared_ptr< Backend > tgui::getBackend ( )

Returns the global backend.

Returns
Global backend
Warning
This function will assert if no backend has been created yet or after it has been destroyed.
See also
isBackendSet()

◆ getResourcePath()

TGUI_API const Filesystem::Path & tgui::getResourcePath ( )
nodiscard

Returns the resource path.

This pathname is placed in front of every filename that is used to load a resource.

Returns
The current resource path

◆ isAlpha()

TGUI_API bool tgui::isAlpha ( char32_t character)
nodiscard

Checks whether a character is an alphabetic character.

Parameters
characterCharacter to be examined
Returns
True if the character is an alphabetic character, false otherwise

◆ isBackendSet()

TGUI_API bool tgui::isBackendSet ( )

Checks whether the backend differs from a nullptr.

Returns
Has setBackend been called with a valid backend?

◆ isDigit()

TGUI_API bool tgui::isDigit ( char32_t character)
nodiscard

Checks whether a character is digit (only 0 to 9 are considered digits, no unicode characters are)

Parameters
characterCharacter to be examined
Returns
True if the character is a digit , false otherwise

◆ isWhitespace() [1/2]

TGUI_API bool tgui::isWhitespace ( char character)
nodiscard

Checks if a character is a whitespace character (e.g. space, tab, carriage return, line feed, ...)

Parameters
characterCharacter to be examined
Returns
True if the character is a whitespace character, false otherwise

◆ isWhitespace() [2/2]

TGUI_API bool tgui::isWhitespace ( char32_t character)
nodiscard

Checks if a character is a whitespace character (e.g. space, tab, carriage return, line feed, ...)

Parameters
characterCharacter to be examined
Returns
True if the character is a whitespace character, false otherwise

◆ readFileToMemory()

TGUI_API std::unique_ptr< std::uint8_t[]> tgui::readFileToMemory ( const String & filename,
std::size_t & fileSize )
nodiscard

Opens a file and reads its contents into memory.

Parameters
filenamePath to the file to read
fileSizeSize of the file, to be filled in by this function if loading succeeds (untouched on failure)
Returns
Bytes read from the file, or nullptr if loading failed (or file was empty)

On android, the file will be read using the asset manager if a relative filename is passed.

◆ setBackend()

TGUI_API void tgui::setBackend ( std::shared_ptr< Backend > backend)

Changes the global backend.

This function is automatically called when the first Gui object is created. When all Gui objects have been destructed, this function will be called again with a nullptr as parameter to destroy all global resources.

If you want to use TGUI functionality before creating a Gui object then you should call this function directly.

Warning
When calling the function directly, it has to be the first call to TGUI and you must call setBackend(nullptr) before the end of the main() function.

◆ setResourcePath() [1/2]

TGUI_API void tgui::setResourcePath ( const Filesystem::Path & path)

Sets a new resource path.

This pathname is placed in front of every filename that is used to load a resource.

Parameters
pathNew resource path

◆ setResourcePath() [2/2]

TGUI_API void tgui::setResourcePath ( const String & path)

Sets a new resource path.

This pathname is placed in front of every filename that is used to load a resource.

Parameters
pathNew resource path

◆ viewEndsWith() [1/4]

bool tgui::viewEndsWith ( CharStringView viewToLookInto,
char charToLookFor )
inlinenodiscard

Checks whether the view ends with the given character.

Parameters
viewToLookIntoView to check
charToLookForCharacter that will be compared with the last character of the view
Returns
True if the view ends with the character, false if the view ends with a different character or is empty

◆ viewEndsWith() [2/4]

bool tgui::viewEndsWith ( CharStringView viewToLookInto,
CharStringView viewToLookFor )
inlinenodiscard

Checks whether the view ends with the given substring.

Parameters
viewToLookIntoView to check
viewToLookForString that will be compared with the last characters of the view
Returns
True if the view ends with the substring, false otherwise

◆ viewEndsWith() [3/4]

bool tgui::viewEndsWith ( StringView viewToLookInto,
char32_t charToLookFor )
inlinenodiscard

Checks whether the view ends with the given character.

Parameters
viewToLookIntoView to check
charToLookForCharacter that will be compared with the last character of the view
Returns
True if the view ends with the character, false if the view ends with a different character or is empty

◆ viewEndsWith() [4/4]

bool tgui::viewEndsWith ( StringView viewToLookInto,
StringView viewToLookFor )
inlinenodiscard

Checks whether the view ends with the given substring.

Parameters
viewToLookIntoView to check
viewToLookForString that will be compared with the last characters of the view
Returns
True if the view ends with the substring, false otherwise

◆ viewEqualIgnoreCase() [1/2]

bool tgui::viewEqualIgnoreCase ( CharStringView view1,
CharStringView view2 )
inlinenodiscard

Returns whether two view are equal if letters would have been lowercase.

Parameters
view1First view to compare
view2Second view to compare
Returns
Are the views equal except for the case of letters?

◆ viewEqualIgnoreCase() [2/2]

bool tgui::viewEqualIgnoreCase ( StringView view1,
StringView view2 )
inlinenodiscard

Returns whether two view are equal if ASCII letters would have been lowercase.

Parameters
view1First view to compare
view2Second view to compare
Returns
Are the views equal except for the case of ASCII letters?

◆ viewStartsWith() [1/4]

bool tgui::viewStartsWith ( CharStringView viewToLookInto,
char charToLookFor )
inlinenodiscard

Checks whether the view starts with the given character.

Parameters
viewToLookIntoView to check
charToLookForCharacter that will be compared with the first character of the view
Returns
True if the view starts with the character, false if the view starts with a different character or is empty

◆ viewStartsWith() [2/4]

bool tgui::viewStartsWith ( CharStringView viewToLookInto,
CharStringView viewToLookFor )
inlinenodiscard

Checks whether the view starts with the given substring.

Parameters
viewToLookIntoView to check
viewToLookForString that will be compared with the first characters of the view
Returns
True if the view starts with the substring, false otherwise

◆ viewStartsWith() [3/4]

bool tgui::viewStartsWith ( StringView viewToLookInto,
char32_t charToLookFor )
inlinenodiscard

Checks whether the view starts with the given character.

Parameters
viewToLookIntoView to check
charToLookForCharacter that will be compared with the first character of the view
Returns
True if the view starts with the character, false if the view starts with a different character or is empty

◆ viewStartsWith() [4/4]

bool tgui::viewStartsWith ( StringView viewToLookInto,
StringView viewToLookFor )
inlinenodiscard

Checks whether the view starts with the given substring.

Parameters
viewToLookIntoView to check
viewToLookForString that will be compared with the first characters of the view
Returns
True if the view starts with the substring, false otherwise

◆ writeFile() [1/2]

TGUI_API bool tgui::writeFile ( const String & filename,
CharStringView textToWrite )

Opens a file and writes the given contents to it.

Parameters
filenamePath to the file to write
textToWriteContents to be written to the file
Returns
True on success, false if opening or writing to the file failed

◆ writeFile() [2/2]

TGUI_API bool tgui::writeFile ( const String & filename,
const std::stringstream & textToWrite )

Opens a file and writes the given contents to it.

Parameters
filenamePath to the file to write
textToWriteContents to be written to the file
Returns
True on success, false if opening or writing to the file failed