Today we will take the next step in our exciting journey as a Scratch developer. This time we will play with text animation. Our goal is to enlarge individual letters when you hover the mouse over them. In addition, we will use the effects component available in Scratch to make our animation look even fancier. Before we go into the details, let's check the end result.
The first step is to create four sprites. Each of them will represent an individual letter of the word DEVS. Each letter must have its own dedicated color. We will choose the following letter colors:
- D – green
- E – yellow
- V – red
- S – blue
The outline should be gray and size 1.
We need to save the current zoom value for each individual letter. Let's create a new variable called zoom for the first sprite D.
Traditionally, we run the script by clicking the green flag. We assume that the initial size of the letter is 50. In the foreach loop, when the sprite is hovered over, we want to increase its size by 2 until the value is 100. Additionally, we rotate the letter to the right by 1. Don't forget to set a point in direction 90 before the loop so that we reset the letter position every time we run it. When the mouse pointer leaves the sprite, we set the zoom and rotation to their default values.
The procedure for creating the letter E is very similar. Again we need to create the zoom variable and script code. The difference is that here we add the change brightness effect by component. We will increase the brightness when the mouse touches the letter.
The letter V should utilize the change color effect by, thanks to which its color will change dynamically during the animation.
The last letter S will have the most attractive shape-changing effect. To do this, we need to use the change whirl effect by.
As always, thanks for reaching the end of the article. Don’t forget to download the final project from here.
Happy scratching!
Comments
Post a Comment