The text
shape draws any text/string on the canvas at the position specified in the parameters.
The font used to render the text is the default one and cannot be changed at the moment. Like the text font, the size of the text is also a constant and cannot be changed.
To understand how to declare and draw a shape please refer, to this document.
To declare and draw a text
shape named greeting
with text "Hello" at position (100, 100)
in color RED we write the following statement.
shape greeting(text):
.text = "Hello"
.color = RED
.position = (100, 100)
endshape
Parameter | Description | Possible values | Default | Required? |
---|---|---|---|---|
text | text to be drawn | any text | - | Yes |
position | the position at which the text is to be drawn | point | - | Yes |
color | the color of the text | builtin colors | BLACK | No |
Currently there is no way to change the font or the size.
Notice any errors or typos? Please let us know or feel free to edit text.md and issue a pull request.
Follow us on twitter @RevineLang
Built by Arpit Bhayani