Panda Pig • Patty original or translated works. Welcome reprint, Reprint please indicate the source.
If you feel that the writing is not good please tell me, if you feel good please support a lot of praise. Thank you! Hopy;)
A good game also needs a nice package. When the player enters the game, the first thing to see is the main interface of the game, and how to vividly display an attractive interface is the subject of this article. Of course, this is not the main interface for business games, just to show you don't have to write what code, You can also make the main interface more lively.
Adding static elements to the main interface
Open the MAINSCENE.CCB file in Spritebuilder and delete the original control, and the scene becomes dark. It doesn't matter, we'll add a cute background to it and drag bg.png into the scene:
Drag the corresponding control from the control library into the scene, as shown in the following layout:
From top to bottom, there are 4 elements, namely: Game Name, version number, Start button, and small title. Let's see how we can make them lively;)
Animation effect One: element homing
First set the default timeline time to 5 seconds to enable AutoPlay:
The position and skew (twisted) animations that set the game name label separately are as follows:
Then, at the appropriate point in time, set the animation of the following 3 elements respectively: Visible,position and opacity:
We can play and constantly adjust the effect, the final effect is as follows:
Animation effect Two: element discoloration
Create a new animation set with the name color Loop:
The time is also set to 5 seconds, we set the game name and the small title label gradient effect, while the linear gradient changes to a nonlinear gradient:
The complete results are as follows:
Now publish the project, open Xcode, compile and run the app, the main interface effect shows as follows:
So a simple main interface animation is done, and we haven't written a single line of code yet;)
It's just time to write some code and see it in the next chapter.
(no.00004) iOS implementation brick game (II): Realization of the game main screen animation