![]() |
nomlib
|
#include <Text.hpp>
Public Types | |
| enum | Style : uint32 { Normal = 0 , Bold = 2 , Italic = 4 , Underline = 8 , Strikethrough = 16 } |
| Font face style; multiple styles can be combined from bitwise masks. More... | |
| typedef Text | self_type |
| typedef Transformable | derived_type |
| Public Types inherited from nom::Transformable | |
| typedef Transformable | self_type |
| Public Types inherited from nom::IDrawable | |
| typedef IDrawable | self_type |
| typedef self_type * | raw_ptr |
| A type definition for a C pointer – raw pointer – to an IDrawable object. | |
| typedef std::unique_ptr< self_type > | unique_ptr |
| A type definition for a C++11 std::unique_ptr to an IDrawable object. | |
| typedef std::shared_ptr< self_type > | shared_ptr |
| A type definition for a C++11 std::shared_ptr to an IDrawable object. | |
| typedef const RenderWindow | RenderTarget |
| Public Types inherited from nom::IObject | |
| typedef IObject | self_type |
| typedef IObject * | raw_ptr |
Public Member Functions | |
| Text (void) | |
| Default constructor. | |
| ~Text (void) | |
| Destructor. | |
| Text (const std::string &text, const Font &font, uint character_size=nom::DEFAULT_FONT_SIZE, const Color4i &text_color=Color4i::White) | |
| Construct a Text, initializing it with a text string, a nom::Font object reference and character size. | |
| Text (const std::string &text, Font *font, uint character_size=nom::DEFAULT_FONT_SIZE, const Color4i &text_color=Color4i::White) | |
| Construct a Text, initializing it with a text string, a nom::Font object pointer and character size. | |
| Text (const self_type &rhs) | |
| Copy constructor. | |
| self_type & | operator= (const self_type &rhs) |
| Copy assignment operator. | |
| virtual void | set_position (const Point2i &pos) override |
| Set the position of the rendered text. | |
| Text * | clone () const |
| Implements the required IDrawable::clone method. | |
| ObjectTypeInfo | type () const override |
| Re-implements the IObject::type method. | |
| const Font & | font () const |
| Texture * | clone_texture () const |
| Get a deep-copy instance of the underlying texture used for the text rendering. | |
| bool | valid (void) const |
| Obtain validity of the Text object. | |
| int | text_width (const std::string &text_buffer) const |
| Obtain the text width (in pixels) of the set text. | |
| sint | text_height (const std::string &text_string) const |
| Obtain the text height in pixels of the set text. | |
| const std::string & | text (void) const |
| Get text string. | |
| const Color4i & | color (void) const |
| Get text color. | |
| uint32 | style (void) const |
| Get text style. | |
| uint | text_size (void) const |
| Get text character size (in pixels?). | |
| void | set_font (const Font &font) |
| Set the font to use in rendering text. | |
| void | set_font (Font *font) |
| Set the font to use in rendering text. | |
| void | set_text (const std::string &text) |
| Set the text string to be rendered. | |
| void | set_text_size (uint character_size) |
| Set the text's font point size. | |
| void | set_color (const Color4i &text_color) |
| Set text's font color. | |
| void | set_style (uint32 style) |
| Set the text's rendering style for the font. | |
| void | set_text_kerning (bool state) |
| Set the use of rendering glyphs with respect to kerning offsets, when supported by the underlying font type. | |
| void | draw (RenderTarget &target) const override |
| Public Member Functions inherited from nom::Transformable | |
| Transformable (const Point2i &pos, const Size2i &size) | |
| Transformable (const IntRect &bounds) | |
| Construct an object using a complete set of coordinates (bounds). | |
| ObjectTypeInfo | type () const override |
| Re-implements the IObject::type method. | |
| const Point2i & | position (void) const |
| Getter for stored positioning coordinates. | |
| const Size2i & | size (void) const |
| Getter for stored size dimensions. | |
| virtual void | set_size (const Size2i &size) |
| Set the size dimensions– width & height rendering coordinates of the object. | |
| virtual void | set_bounds (const IntRect &bounds) |
| Set the complete bounds of the object – position (X, Y) and size (width and height) dimensions. | |
| void | set_position (int x, int y) |
| void | set_size (int w, int h) |
| virtual void | translate (const Point2i &pos) |
| Public Member Functions inherited from nom::IDrawable | |
| IDrawable (void) | |
| Do nothing at all default constructor. | |
| virtual | ~IDrawable (void) |
| Do nothing at all destructor. | |
| Public Member Functions inherited from nom::IObject | |
| IObject (void) | |
| Default constructor. | |
| virtual | ~IObject (void) |
| Virtual destructor. | |
| virtual bool | is_type (const ObjectTypeInfo &rhs) const |
| Compare this object type with another object's type. | |
Private Member Functions | |
| void | render_text (RenderTarget &target) const |
| void | update () override |
| Apply requested transformations, styles, etc. | |
| int | width () const |
| Get the current text width. | |
| int | height () const |
| Get the current text height. | |
| bool | update_cache () |
| int | multiline_width (const std::string &text_buffer, nom::size_type pos) const |
Private Attributes | |
| Font | font_ |
| Texture | glyphs_texture_ |
| A texture atlas created from the nom::Font instance that is referred to in rendering a text. | |
| std::unique_ptr< Texture > | rendered_text_ |
| The texture containing the rendered text. | |
| std::string | text_ |
| Holds contents of text as a string buffer. | |
| uint | text_size_ |
| Color4i | color_ |
| uint32 | style_ |
| Current text effect set. | |
| bool | dirty_ |
Additional Inherited Members | |
| Static Public Member Functions inherited from nom::IObject | |
| template<typename Base, typename Derived> | |
| static bool | is_a (const Derived object) |
| Compare two objects to determine if a derived class inherits from a base class object. | |
| static void * | operator new (nom::size_type mem) |
| static void | operator delete (void *ptr) |
| Static Public Attributes inherited from nom::IObject | |
| static uint64 | total_alloc_bytes |
| static uint64 | total_dealloc_bytes |
| enum nom::Text::Style : uint32 |
Font face style; multiple styles can be combined from bitwise masks.
| Enumerator | |
|---|---|
| Bold | Default. |
| nom::Text::Text | ( | const self_type & | rhs | ) |
Copy constructor.
| Texture * nom::Text::clone_texture | ( | ) | const |
Get a deep-copy instance of the underlying texture used for the text rendering.
|
overridevirtual |
| self_type & nom::Text::operator= | ( | const self_type & | rhs | ) |
Copy assignment operator.
| void nom::Text::set_font | ( | const Font & | font | ) |
Set the font to use in rendering text.
| void nom::Text::set_font | ( | Font * | font | ) |
Set the font to use in rendering text.
|
overridevirtual |
Set the position of the rendered text.
Reimplemented from nom::Transformable.
| void nom::Text::set_style | ( | uint32 | style | ) |
Set the text's rendering style for the font.
| void nom::Text::set_text_size | ( | uint | character_size | ) |
Set the text's font point size.
| sint nom::Text::text_height | ( | const std::string & | text_string | ) | const |
Obtain the text height in pixels of the set text.
| int nom::Text::text_width | ( | const std::string & | text_buffer | ) | const |
Obtain the text width (in pixels) of the set text.
|
overridevirtual |
Re-implements the IObject::type method.
Reimplemented from nom::IDrawable.
|
overrideprivatevirtual |
Apply requested transformations, styles, etc.
Implements nom::IDrawable.
|
private |
|
mutableprivate |
|
private |
|
private |