class GSF::StyledText

Defined in:

gsf/styled_text.cr

Constant Summary

FontSize = 10

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(raw_text : String = "", font = SF::Font.new, font_size = FontSize) #

[View source]

Class Method Detail

def self.get_styles(style_types : String) : Array(SF::Text::Style) #

[View source]
def self.hex_to_color(color_hex : String) : SF::Color #

[View source]

Instance Method Detail

def draw(target : SF::RenderTarget, states : SF::RenderStates) #
Description copied from class SF::Text

:nodoc:


[View source]
def global_bounds #
Description copied from class SF::Text

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


[View source]
def parse_text_sections #

[View source]
def string=(string : String) #
Description copied from class SF::Text

Set the text's string

A text's string is empty by default.

  • string - New string

See also: string


[View source]
def to_words_and_spaces : Array(SF::Text) #

[View source]