Turtle Graphics - Drawing Text
[Index] [<< Previous section: Turtle Animation] [Next section: Drawing Graphic Objects >>]
label text
- Description: takes a word or list as input, and strokes the input on the graphics canvas, starting at the turtle's position.
- Note: The text's color is the stroking color (set it using
setpencolor
).- Example 1:
label "LOGO
- Example 2:
right 90
setlabelheight 40
label [I love logo!] - Note: The text's color is the stroking color (set it using
flabel text
- Description: takes a word or list as input, and fills the input on the graphics canvas, starting at the turtle's position.
- Note: The text's color is the filling color (set it using
setfillcolor
).- Example 1:
right 90
setlabelheight 40
setfillcolor "red
flabel "LOGO- Example 2: You can use both commands when drawing a text:
right 90
setlabelheight 40
setfillcolor "red
flabel [I love logo!]
label [I love logo!] - Note: The text's color is the filling color (set it using
setlabelheight size
- Description: sets the font
size
for the text to be drawn.- Default value: 14.
- Example:
right 90
setlabelheight 40
label "Logo - Default value: 14.
setlabelfont name
- Description: sets the font
name
for the text to be drawn.- Default value: Arial.
- Example:
right 90
setlabelheight 40
setfillcolor "red
label [My turtle]
rt 90 fd 50 lt 90
setlabelfont [Courier New]
label [My turtle] - Default value: Arial.
[Index] [<< Previous section: Turtle Animation] [Next section: Drawing Graphic Objects >>]