Du bist hier: Home » small payday loans online » 31 times of Windows mobile | Day #29: Animations. This post is Day #29 in a set called the 31 times of Windows mobile.

31 times of Windows mobile | Day #29: Animations. This post is Day #29 in a set called the 31 times of Windows mobile.

31 times of Windows mobile | Day #29: Animations. This post is Day #29 in a set called the 31 times of Windows mobile.

Yesterday, we penned on how to monetize your applications through marketing. Today I’m planning to explain to you simple tips to add some motion and flair to the application by utilizing animations.

That Awesome Door Open Animation

You get this really nice “door open” animation that happens before your application loads if you’ve ever opened an application in the emulator. I’m going to demonstrate you the way to include that form of animation to your pages. (It is really surprisingly easy. )

Grab yourself a project that is new the Windows Phone Application template if you’d like to follow along), and add a rectangle towards the Grid known as ContentPanel. Here’s what mine appears like:

For producing the animation, we’re planning to perform some rest for this work with Expression Blend 4. To start any project in Blend, right click about it in artistic Studio 2010, and choose the “Open in Expression Blend” option.

As soon as you’ve gotten assembling your project available in Expression Blend, get the “Objects and Timeline” tab. There is certainly a“+ that is little sign with this tab, also it’s for producing brand new animations, or “storyboards”.

Once you click that “+” symbol, you’ll get a dialog that appears like this. Provide your animation a title:

You’ll have returned to your items and Timeline tab, however now there’s a actual schedule to the proper of one’s web web page objects. To start to see the timeline better, press the F6 key on the keyboard. It’s going to re-arrange the tabs in Expression, going the www.paydayloansohio.net/ things and Timeline tab into the bottom that is entire of application.

For our “DoorOpen” animation, we’re likely to be manipulating every one of the content on our web page. Fortunately, because of the hierarchical nature of Silverlight, we should just target the element that is layoutRoot. Select LayoutRoot into the items and Timeline tab, to check out an egg-shaped icon above the Zero moments line.

That symbol shows a Keyframe. Keyframes are the ones pivotal times in your animation whenever something changes. Silverlight is sensible adequate to be able to figure out the remainder associated with the animation for you personally. Therefore, within our instance, we’re planning to determine the start and ending of our animation, and Silverlight will need proper care of the others. Click on the Keyframe switch when you yourself haven’t currently.

The reason why we produce a Keyframe at Zero moments is basically because we wish set up a baseline. We’re fundamentally saying which our element is in the” that is“starting, so we want one to record that data. We now have an added thing we have to improvement in our “starting” position, and that is exactly what the rotational center of y our item should really be. By standard, the biggest market of rotation could be the center regarding the object, but we would like our animation to fundamentally turn through the remaining side of the display screen.

Ensuring that LayoutRoot is chosen, and that there was just a little “egg” symbol on Zero moments, have a look at the characteristics tab. Inside the “Transform” category, there is certainly another tab labeled Center of Rotation (it’s under the Projection area). You really need to note that the X and Y values are both set to 0.5 ( the center of the element. ) We should alter our X value to 0, or perhaps the remaining side of the element.

Then, head returning to Object and Timeline. Go the line that is yellow indicates time about halfway amongst the 0 and 1. While you move it, you’ll start to see the time change next towards the Keyframe switch.

This time around, we’re planning to change the Projection. Rotation home. Open that right area of the qualities tab up (it had been in order to the left associated with Center of Rotation), and alter the Y value to 90. This may have our content rotate 90 levels towards the left in a rotation that is 3d.

You should be able to see this animation happening now if you hit the “Play” button above the timeline. But we continue to have yet another action to just simply take before this animation will take place within our application. We must phone it from rule. That we’ve developed by using most of the above actions, right here it really is (I’ve included my entire MainPage. Xaml if you’d want to see the XAML in order to see most of the changes):

Calling Animations From Code. Once we’ve created our animation, we are able to save your self every thing, and near Expression Blend.

Return to Studio that is visual 2010 and start the code-behind file: MainPage. Xaml. Cs. We’re going to introduce our animation when someone clicks on our rectangle (the main one we added at the start, keep in mind? )

Our step that is first is produce a conference handler when it comes to simply simply click of this rectangle, in addition to 2nd is to execute the Begin() technique on our storyboard. Here’s just just what my MainPage. Xaml. Cs file appears like now:

In order that’s it! Go ahead and utilize this animation in your applications, so you might have that exact same “open door” animation that you see throughout the operating-system.

Down load the Code

This test rule includes most of the rule shown above in a working project that is full. Please down load it and go on it apart, to enable you to begin animations that are using the job.


Download PDF  Artikel drucken (PDF)

Über den Autor

Benjamin Kratsch
Anzahl der Artikel : 3638

© back view e.V., 2007 - 2017

Scrolle zum Anfang