Goal: Click on each character to see a new message in the text box.
Vocabulary: ct (cleartext), insert, settc
- Draw characters or objects for your project. Select, copy and paste each one into a shape. Hatch a turtle for each character or object and place a shape on it.
- Create a text box and stretch it to fill a strip along the bottom of the page.
- Create a procedure for each character.
Ct (cleartext) erases all text in the text box.
- Settc stands for "set text color." It can be followed by a color name or number.
Settc "red sets the text color to red.
Settc 15 also sets the text color to red.
Set a different color for each character's message.
- In each procedure, write a message from that character in the brackets after insert. Insert takes the text from inside the brackets and copies it into the current text box.
- Open each turtle's backpack. For its OnClick rule, write the name of that character's procedure.
- Now when you click on each character, in the text box you will see a new message in a new color.
What happens if you remove the command ct (cleartext)
from the beginning of each procedure?
What happens if you write a very long message from one of the characters? (Will it fit in the text box?)
Can you change the font, size, or style of the text in each message?
, or setstyle
. Example: setfont "Georgia
or setfont "|Times New Roman|