SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::TextRef Struct Reference

Semi-safe reference for Text.

Inheritance diagram for SDL::TextRef:
Inheritance graph
[legend]
Collaboration diagram for SDL::TextRef:
Collaboration graph
[legend]

Public Member Functions

 TextRef (TextParam resource=nullptr)
 Constructs from TextParam. More...
 
 TextRef (const TextRef &other)
 Copy constructor.
 
 ~TextRef ()
 Destructor.
 
- Public Member Functions inherited from SDL::Text
constexpr Text ()=default
 Default ctor.
 
constexpr Text (const TextRaw resource)
 Constructs from TextParam. More...
 
constexpr Text (const Text &other)=delete
 Copy constructor.
 
constexpr Text (Text &&other)
 Move constructor.
 
constexpr Text (const TextRef &other)=delete
 
constexpr Text (TextRef &&other)=delete
 
 Text (TextEngineParam engine, FontParam font, std::string_view text)
 Create a text object from UTF-8 text and a text engine. More...
 
 ~Text ()
 Destructor.
 
Textoperator= (Text other)
 Assignment operator.
 
constexpr TextRaw get () const
 Retrieves underlying TextRaw.
 
constexpr TextRaw release ()
 Retrieves underlying TextRaw and clear this.
 
constexpr auto operator<=> (const Text &other) const =default
 Comparison.
 
constexpr bool operator== (std::nullptr_t _) const
 Comparison.
 
constexpr operator bool () const
 converts to bool
 
constexpr operator TextParam () const
 Converts to TextParam.
 
void Destroy ()
 Destroy a text object created by a text engine. More...
 
void DrawSurface (Point p, SurfaceParam surface) const
 Draw text to an SDL surface. More...
 
void DrawRenderer (FPoint p) const
 Draw text to an SDL renderer. More...
 
GPUAtlasDrawSequenceGetGPUDrawData () const
 Get the geometry data needed for drawing the text. More...
 
PropertiesRef GetProperties () const
 Get the properties associated with a text object. More...
 
void SetEngine (TextEngineParam engine)
 Set the text engine used by a text object. More...
 
TextEngineParam GetEngine () const
 Get the text engine used by a text object. More...
 
bool SetFont (FontParam font)
 Set the font used by a text object. More...
 
FontRef GetFont () const
 Get the font used by a text object. More...
 
void SetDirection (Direction direction)
 Set the direction to be used for text shaping a text object. More...
 
Direction GetDirection () const
 Get the direction to be used for text shaping a text object. More...
 
void SetScript (Uint32 script)
 Set the script to be used for text shaping a text object. More...
 
Uint32 GetScript () const
 Get the script used for text shaping a text object. More...
 
void SetColor (Color c)
 Set the color of a text object. More...
 
void SetColorFloat (FColor c)
 Set the color of a text object. More...
 
void GetColor (Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) const
 Get the color of a text object. More...
 
Color GetColor () const
 Get the color of a text object. More...
 
void GetColorFloat (float *r, float *g, float *b, float *a) const
 Get the color of a text object. More...
 
FColor GetColorFloat () const
 Get the color of a text object. More...
 
bool SetPosition (Point p)
 Set the position of a text object. More...
 
bool GetPosition (int *x, int *y) const
 Get the position of a text object. More...
 
Point GetPosition () const
 Get the position of a text object. More...
 
void SetWrapWidth (int wrap_width)
 Set whether wrapping is enabled on a text object. More...
 
int GetWrapWidth () const
 Get whether wrapping is enabled on a text object. More...
 
void SetWrapWhitespaceVisible (bool visible)
 Set whether whitespace should be visible when wrapping a text object. More...
 
bool IsWrapWhitespaceVisible () const
 Return whether whitespace is shown when wrapping a text object. More...
 
void SetString (std::string_view string)
 Set the UTF-8 text used by a text object. More...
 
void InsertString (int offset, std::string_view string)
 Insert UTF-8 text into a text object. More...
 
void AppendString (std::string_view string)
 Append UTF-8 text to a text object. More...
 
void DeleteString (int offset, int length)
 Delete UTF-8 text from a text object. More...
 
void GetSize (int *w, int *h) const
 Get the size of a text object. More...
 
Point GetSize () const
 Get the size of a text object. More...
 
void GetSubString (int offset, SubString *substring) const
 Get the substring of a text object that surrounds a text offset. More...
 
SubStringIterator begin () const
 Get iterator to first substring.
 
SubStringIterator end () const
 Get iterator to one past last substring.
 
SubStringIterator GetSubStringForLine (int line) const
 Get iterator to substring of a text object that contains the given line. More...
 
void GetSubStringForLine (int line, SubString *substring) const
 Get the substring of a text object that contains the given line. More...
 
OwnArray< SubString * > GetSubStrings () const
 Get all substrings of a text object. More...
 
OwnArray< SubString * > GetSubStringsForRange (int offset, int length=-1) const
 Get the substrings of a text object that contain a range of text. More...
 
SubStringIterator GetSubStringForPoint (Point p) const
 Get the portion of a text string that is closest to a point. More...
 
void GetSubStringForPoint (Point p, SubString *substring) const
 Get the portion of a text string that is closest to a point. More...
 
void GetPreviousSubString (const SubString &substring, SubString *previous) const
 Get the previous substring in a text object. More...
 
void GetNextSubString (const SubString &substring, SubString *next) const
 Get the next substring in a text object. More...
 
void Update ()
 Update the layout of a text object. More...
 
const char * GetText () const
 A copy of the UTF-8 string that this text object represents, useful for layout, debugging and retrieving substring text.
 
int GetNumLines () const
 The number of lines in the text, 0 if it's empty.
 

Constructor & Destructor Documentation

◆ TextRef()

SDL::TextRef::TextRef ( TextParam  resource = nullptr)
inline
Parameters
resourcea TextRaw or Text.

This does not takes ownership!


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