Time for action - address the card

We have not placed one block of code in our birthday card. That will change soon enough, but we have one more graphic element to add. I'm sending my card to my mom, so I'm going to spell "Mom." You may choose anyone you want, but I'd recommend you to keep the name short for this exercise.

  1. From the sprites list, click on choose new sprite from file to display the New Sprite dialog box.
  2. We're going to spell out the word "Mom" using letters we find in the Costumes | Letters folder. Click on Costumes.
  3. Double-click on the Letters folder to display a folder of letter types. Let's open the funky folder by double-clicking on it.
  4. Scroll down the list of letters, select M and click OK. The letter M appears on the stage.
  5. It's a good thing we didn't decide to spell "Happy Birthday" this way. Finish spelling "Mom" with letters from the funky letters folder.
  6. Our letters are stacked on top of each other on the stage, so we need to move them around in order to read the word "Mom." Click on each letter and drag it to the preferred point on the stage.
Time for action - address the card

What just happened?

"Happy Birthday, Mom." Now it's starting to look like a card. For the grammarians among us, feel free to insert a comma after birthday.

One letter at a time, we brought Mom to the stage. I don't know about you, but this exercise made me want to cheer. "Give me an 'M.' Give me an 'O'. Give me an 'M'."

Did you make an observation as you dragged each letter around the stage to correctly spell Mom? You dragged the "M," the "O," and the "M" independently of one another. We can't drag each letter in the Happy Birthday sprite around the stage. Go ahead, give it a try. You can move the entire phrase, but you can't separate Happy from Birthday.

Working with sprites

Take a look at your sprites list. It contains four sprites plus a stage.

The difference in our sprites comes from the way they were added to the project. We created the Happy Birthday sprite using the Paint Editor's Text tool. We set the display characteristics by choosing the font, color, and size. We can't edit Happy Birthday from the stage, but we can edit the text again later via the text editor.

When we added the funky font letters to spell "Mom", we really chose images from Scratch's library that represented a letter in the font. Think of it this way: We have one image on the stage that says "Happy Birthday", and every time we see that image, it will say "Happy Birthday."

On the other hand, we can position the O between the two M'S to spell mom, but we could just as easily arrange the images of the letters as MMO. But that would be nonsense.

This is just like the magnetic poetry kits that you can stick on the refrigerator. Sometimes the kit includes whole words or phrases. Other times, the kit comes with individual letters you must arrange to form words and phrases.

If you want to be able to animate and control each letter, you need to add images one at a time to spell the word.

Animating the card

This is the 21st century, and we can do much better than a card with static pictures. We want animation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.98.166