Time for action - add new pages

Next, we are going to add two backgrounds to our project to represent pages in our book. This topic, from the picture slideshow project in Chapter 4, should be familiar to you. However, this time we will integrate a sprite with a background.

With the stage selected, let's get started:

  1. We need a background for the horse. From the Backgrounds tab, click import.
  2. Choose the hay_field image from the Outdoors folder.
    Time for action - add new pages
  3. Our dog prefers a bed to hay. Import the bedroom1 image from the Indoors folder.
Time for action - add new pages

The animals in our story are stand-up comedians at heart, and they love the stage. So, we're going to add a microphone to our new backgrounds:

  1. From the Backgrounds tab, edit the hay_field background to open it in the Paint Editor.
  2. Import the microphone from the Costumes | Things folder. Click the Import button, which is located in the top-left corner of the Paint Editor. The Import Picture dialog box displays.
  3. Navigate to the Costumes | Things folder and select the image named mic. Click OK to add the image.
  4. That's a big microphone compared to our landscape. Click the Shrink button twice.
  5. Drag the microphone to the bottom-right corner of the stage so that it blends with our landscape better.
  6. Click OK to exit the Paint Editor and return to Scratch.
Time for action - add new pages

The hay_field background displays with the microphone. Try to move the microphone or make it smaller with the shrink sprite tool. Don't try for too long; you won't be able to manipulate the microphone.

What just happened?

The backgrounds we inserted tell us a story by providing some contextual information. For example, many pet dogs like to spend their days inside on the bed, and while we may not find horses roaming on the hay fields, they do eat hay. It's up to us to use design effectively in our stories.

The microphone provides some unique character to our story that fits with the comedy theme. We added the microphone to the hay field background to form a new image. That's why we can't move the microphone.

Hide that sprite

Click through each stage background to display it on the stage. We have our first problem. The table of contents display on each background, but that doesn't make much sense.

We want sprites to be associated with specific backgrounds, so that each page tells its own story. If we have extra sprites on the screen, they'll muddle our message. We got a first look at this problem when we created the happy birthday card in Chapter 3, and we solved it by hiding all the images when the flag was clicked.

One way we can associate a sprite with a background is by importing a sprite into a background like we did with the microphone in the last excerise.

The trade-off with this approach is that we can no longer manipulate the sprite because it has become integrated with the background. If we look at our sprites list, we'll notice the microphone is not listed.

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

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