One of the major features in 2.7 for Color displays is support for high performance animation. Animation allows you to do complex changes to screen objects without having to incur a large penalty in performance. These actions are available to use in state machines as well as in scripting. In fact for the first time, Animation is actually easier to do with scripting. To get you all started i thought i would spend a few minutes explaining how our animation system works.
Animation is a method of generating changes to screen objects over time. We support Position, Scale, Rotation, Alpha and Color animations. The goal of an animation action is to describe the destination of the change. For example "I want to move the object to X=100,Y=200" or "I want to change the object from Blue to Red" With an animation action, you simply describe the final change, and the system will generate all of the intermediate steps to get there such as changing color a small amount at a time or moving the object in each frame.
While each animation object will differ in the value it captures for the destination (X/Y, Color, etc) animation objects use the same basic structure to define how calculate the intermediate steps. The following properties are available to describe the changes to the object.
X/Y/Rotation/ScaleX/ScaleY: These are the expressions that describes the destination (where you want the object to be) when the animation is complete. Please note PowerVision includes a number of Constant values that allow you to refer to the current value on an object. For example you can reference the current location with CurrentX/Y. This means you can move a distance from its current location using the expression of CurrentX+10 for example.
Occurs X Times: "Recurrence in Scripting" - This is the number of frames (screen redraws) that it will take to complete the animation. Note that this is true screen draws…so if you have a slow refresh rate due to system processing slows the animation…in change for this there is almost no impact on system performance.
Animation Style: "Type in scripting" - This is the curve that is used to accelerate or decelerate the animation. A Linear Style means that each frame (recurrence) will move exactly the same amount as the last frame (recurrence / distance). A FastInStyle Type uses an exponential curve to quickly approach the target (location in this case) and slow down as it gets closer. (iPhones use this style when a popup or folder is opened. A FastOut is the opposite…it uses an inverse of the FastInStyle to slowly accelerate toward its destination..speeding up as it reaches the end.
Animation Factor – This is an acceleration factor or how much the Style is appied. The higher the factor the more “BENT” the acceleration curve is. A High Factor combined with FastIn would very quickly approach the animation destination and slow down just before it reaches the destination. The factors are Low = 2, Medium = 4 and High = 8.
EventID: Since the action is sent once and then remains there for a number of frames being recalculated, the system sends this event when the last frame has been processed and the action is finally thrown away. This lets you know the animation is complete and can be used to chain animations together. In the demo, there is a bouncing ball (in a state machine) that demonstrates the feature very well.
Note: In general a FastIn/FastOut combined with a Medium Factor is appropriate for most situations. This combination does a good job of simulating gravity for bouncing ball or falling object and is a good setting for opening Menus and Flyouts.
Our Examples package contains a number of examples that you can use to learn more about how to do animation with State Machines or Scripting
PowerVision 2.7 Animation Actions
- jpratt
- Enovation Controls Development
- Posts: 222
- Joined: Mon Jun 21, 2010 11:18 am
PowerVision 2.7 Animation Actions
Jake Pratt
Software Development Manager
Software Development Manager