Animating objects with Flare

Let's switch from Design mode to Animate mode. You'll notice that a timeline appears at the bottom of the page. You'll probably find the timeline familiar if you've used other animation tools, or you've produced video or audio content. A timeline is where you control the progression of your animation. In Flare, you can also specify the duration of the animation and the number of frames per second (FPS).

In the following screenshot, you can see the animation page for our project. Notice the timeline and the duration, and the FPS settings:

FPS, or frame rate, tells how many images will be displayed for every second of animation. The default value of 60 is generally considered extremely high and creates very smooth animations. Flutter aims to provide 60 FPS performance, and this is one of its strengths. Of course, if you want to save some resources in your device, you can try to see how the animation behaves at 30 FPS. In the example in this chapter, we'll leave the default value of 60 FPS.

Now, we'll see how to create our first animation so that we can get familiar with the timeline.

If you select the rectangle, in the Properties pane on the right of the page, you will see all the settings that can be changed in order to perform the animation. For example, you could change the Size/Position of the rectangle. Let's look at the steps, as follows:

  1. Let's say we want to rotate the square 90 degrees. Select the square in the Dice Artboard.
  2. Check that the playhead is positioned at the beginning of the animation (00.00.00 seconds).
  3. The timeline displays objects and properties that have been "keyed". Keying in Flare means adding an object to the animation sequence. Press the diamond shape near the Rotation property of the square—this will key the rotation in the timeline at the beginning of the animation. The diamond changes color and the rectangle appears on the timeline. In the following screenshot, you can see a detail of the result in the Properties pane:

  1. Move the playhead in the timeline to 2 seconds, as shown in the following screenshot:

  1. Set the rotation of the square to 45° and key the square again, as shown in the following screenshot:

  1. If you press the spacebar, you will see that the square is rotating from the initial position to 45 degrees, and it's taking 2 seconds to do that. Flare is "magically" filling all the frames to get there in the 2 seconds that we specified as the duration from the first to the second key.
  2. Repeat the process according to the following table:
0:00
2:00 45°
4:00 90°
6:00 135°
8:00 180°
  1. Set the duration of the animation to 8 seconds.
  2. Rename the animation by double-clicking on its name (untitled). Let's call it Rotate.
  3. Press the Loop button so that the animation will automatically restart as soon as it finishes, and try the animation: you should see the dice rotating endlessly.
You may have noticed that all the circles that you designed on the surface of the square are rotating with the square itself. This happens because the circles are children of the square.

You have now created your first animation and, hopefully, familiarized yourself with the Flare interface. Unfortunately, we won't be using this specific animation in our app, but we can keep it here for reference. Next, we'll create the real animations that will be needed in our app.

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

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