class
Crame::Text
- Crame::Text
- Reference
- Object
Overview
A Text is a Drawable element that represents a string of text.
Any methods in this class is meant to modify the actual content of the text in any way.
Included Modules
Defined in:
crame/text.crConstructors
-
.new(string : String, font : Font)
Creates a new
Textgiven its content andfont.
Instance Method Summary
-
#<<(text : String)
Appends a
textat the end ofself. -
#delete(offset : Int, length : Int) : String
Delete a substring on
selfgiven itsoffsetandlength, and returns it. - #finalize
-
#font=(font : Font)
Sets a new
fontonself. -
#insert(offset : Int, string : String)
Inserts a
stringof text onselfatoffset. -
#text=(text : String)
Sets a new
textonself.
Instance methods inherited from module Crame::Drawable
draw(position : Vector2, angle : Float = 0.0, origin : Vector2 = Vector2.new(0, 0), scale : Vector2 = Vector2.new(1, 1), color : Color = Color.new(1, 1, 1, 1))
draw,
finalize
finalize,
size : Vector2
size
Constructor Detail
Instance Method Detail
def delete(offset : Int, length : Int) : String
#
Delete a substring on self given its offset and length, and returns it.