官术网_书友最值得收藏!

Changing the stage background

Once you've been programming in Scratch for a while, there is a good chance that you may need to change the background to something other than the default white color. Fortunately, Scratch makes this easy to do!

Getting ready

The area directly underneath the stage is where we select the sprite we are currently going to work on the programming for. You'll also notice that on the left side is an icon with a picture of the stage background (currently white if you haven't been straying from this chapter). This icon is labeled stage. Click on this.

If you've done anything in the script area with the sprite you had selected, you'll notice it is no longer visible in the script area. Whatever you do, don't worry. You have a different script area for each sprite as well as the stage.

Note

You might be wondering what we are going to do with the script area for the stage. We won't use this for a while until we get into more advanced programs, but the stage script area is great for programming actions that will occur in the background of your program. Sometimes you may not have a block of programming that isn't specific to a particular sprite. This is where you will put that block.

How to do it…

So let's get rid of that boring background! Follow along with these steps!

  1. In the stage script area, click on the second tab towards the top labelled Backdrops. You can import several backgrounds that you may later on want to access through programming blocks in your block palette. For now, let's just import a new one and delete the white background.
  2. Similar to how we imported new sprites in three different ways; you have towards the top of the Backdrops tab three different options for backgrounds. The second of these brings up the paint editor. If you didn't take the time to get used to the paint editor when making your own sprite this may be a great time to create a background. You can add any colors you want, shapes, or imported images.
    Tip

    Don't import a sprite when creating your own background. If you do, be careful. You may later on try to drag the sprite, thinking it's an actual sprite in your program. This will leave you confused (and possibly frustrated) when you can't get something to work.

  3. If you didn't go down the route of creating your own background, then you can choose the very common import button. Just like the sprite library, you have categories. The categories for your pre-made backgrounds are indoors, nature, outdoors, and sports. You also have an x-y grid you can use if you are getting into some fun with math.
    Tip

    Not happy with the backgrounds available? Don't want to make your own? The dialog box that comes up just points to the folder on your computer where Scratch has put these pre-made designs when it was installed. You can access your pictures on other parts of your computer just as you would in any other software package on your computer.

  4. The third option is to upload an image directly from your computer.
  5. The fourth option you have is to access your computer's webcam and take a picture. Clicking on the camera option will pop up the webcam of your computer. Click on the picture of the camera and you should see your webcam's image pop into the background!
  6. Once you've selected your new background, you'll see it added to the list of backgrounds available to program with. It should look something similar to the following screenshot:

There's more…

To delete the white background we won't need, click the small circle containing an x.

Note

Notice that you can edit or copy backgrounds. This gives you the functionality to customize backgrounds and make them your own. Also, notice that you can change the given name of a background (the default seen in the preceding screenshot is background1). As you build more complicated programs, it may be beneficial to give these names you'll recognize throughout the program. You might find it useful to do the same thing with your sprites; we'll bring this up again later though.

Now that you have a new sprite and a new background, we are ready to create our first program. We may not have a fancy game yet, but it's enough to get us acquainted with Scratch and ready for our next steps.

See also

  • The Hello World project recipe in this chapter.
主站蜘蛛池模板: 沧源| 徐闻县| 贵州省| 广汉市| 康保县| 枣阳市| 华安县| 松江区| 修文县| 普兰县| 奇台县| 曲水县| 视频| 嘉义市| 和田市| 富顺县| 新营市| 穆棱市| 鲁山县| 启东市| 元江| 寿阳县| 广汉市| 仁寿县| 屏山县| 吉木萨尔县| 阳山县| 搜索| 航空| 伊金霍洛旗| 金华市| 清徐县| 孟连| 咸阳市| 长岛县| 广宗县| 伊金霍洛旗| 沐川县| 平邑县| 通州区| 乌什县|