class

GSF::StyledText

Inherits SF::Text < SF::Drawable < SF::Transformable < Reference < Object

Constants

FontSize = 10

Constructors

new(raw_text : String = "", font = SF::Font.new, font_size = FontSize)
Source

Class methods

get_styles(style_types : String) : Array(SF::Text::Style)
Source
hex_to_color(color_hex : String) : SF::Color
Source

Instance methods

draw(target : SF::RenderTarget, states : SF::RenderStates)

:nodoc:

Source
global_bounds

Get the global bounding rectangle of the entity

The returned rectangle is in global coordinates, which means that it takes into account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the text in the global 2D world's coordinate system.

Returns: Global bounding rectangle of the entity

Source
parse_text_sections
Source
string=(string : String)

Set the text's string

A text's string is empty by default.

  • string - New string

See also: string

Source
to_words_and_spaces
Source