class Glint::Label
- Glint::Label
- Glint::Control
- Glint::GameObject
- Reference
- Object
Overview
A game object that displays some text.
Defined in:
glint/game_object/control/label.crConstructors
-
.new(text : String = "", position = Position.new, color : Glint::Color = Color::BLACK, font_size : Int32 = 20, font : Glint::Font = Glint::Font.new, spacing : Float64 = 1.0)
Creates a
Label
.
Class Method Summary
-
.draw(text : String = "", position : Position = Position.new, color = Color::BLACK, font_size : Int32 = 30, font : Font = Glint::Font.new, spacing : Float = 1.0, rotation : Float = 0.0, offset : Position = Position.new)
Draws a
Label
.
Instance Method Summary
-
#color : Color
The label's color.
-
#color=(color : Color)
The label's color.
-
#draw
Draws the
Label
. -
#extents
Returns the extents for the
Label
's text. -
#font : Glint::Font
The label's font.
-
#font=(font : Glint::Font)
The label's font.
-
#font_size : Int32
The label's font size.
-
#font_size=(font_size : Int32)
The label's font size.
-
#spacing : Float64
The label's text spacing.
-
#spacing=(spacing : Float64)
The label's text spacing.
-
#text : String
The label's text.
-
#text=(text : String)
The label's text.
Instance methods inherited from class Glint::GameObject
<<(other : GameObject)
<<,
can_update?
can_update?,
children : Array(GameObject)
children,
delete(other : GameObject)
delete,
draw
draw,
draw_above_children : Bool
draw_above_children,
draw_above_children=(draw_above_children : Bool)
draw_above_children=,
draw_at(position)
draw_at,
draw_children : Bool
draw_children,
draw_children=(draw_children : Bool)
draw_children=,
draw_position : DrawPosition
draw_position,
draw_position=(draw_position : DrawPosition)
draw_position=,
extents : Dimension
extents,
game : Game | Nil
game,
game=(game : Game | Nil)
game=,
has?(other : GameObject)
has?,
parent : GameObject | Game | Nil
parent,
parent=(parent : GameObject | Game | Nil)
parent=,
pivot : Origin
pivot,
pivot=(pivot : Origin)
pivot=,
position : Glint::Vector2
position,
position=(position : Glint::Vector2)
position=,
rotation : Float64
rotation,
rotation=(rotation : Float64)
rotation=,
update(delta)update(delta, &) update, update_mode : UpdateMode update_mode, update_mode=(update_mode : UpdateMode) update_mode=, visible : Bool visible, visible=(visible : Bool) visible=
Constructor Detail
def self.new(text : String = "", position = Position.new, color : Glint::Color = Color::BLACK, font_size : Int32 = 20, font : Glint::Font = Glint::Font.new, spacing : Float64 = 1.0)
#
Creates a Label
.
Class Method Detail
def self.draw(text : String = "", position : Position = Position.new, color = Color::BLACK, font_size : Int32 = 30, font : Font = Glint::Font.new, spacing : Float = 1.0, rotation : Float = 0.0, offset : Position = Position.new)
#
Draws a Label
.