johnvisiomvp

Life with Visio and other Microsoft Toys!

WP7 Flipping Dice – Part II

with one comment

Thanks to a suggestion by Peter, one of my mentors, I abandoned the idea of tapping and went with capturing the flicking gesture.

One of the problems with using a button was hiding the animation caused when the button pressed. There also was other issues.  It just did not feel as natural as flicking. With flicking the code was easy. I needed to create four storyboards; a start and a stop storyboard for each horizontal direction. The ending storyboards had a start time equal to the end time of the starting storyboard. This allowed the pairs of storyboards to be chained. Handling the change of the image at the half way point was done by adding an event handler to the start storyboard to be run when it completed.

Flicking can be done in any direction, so only when the horizontal velocity was non zero and the magnitude of the horizontal velocity exceeded the magnitude of the vertical velocity did I do anything.

With a bit more playing with Blend, I should be able to change the animation from a card to a cube, but as I said I need something for version 2.

John Marshall… Visio MVP       Visio.MVPs.org

Advertisements

Written by johnvisiomvp

October 2, 2011 at 4:13 am

Posted in Windows Phone 7, WP7

Tagged with ,

One Response

Subscribe to comments with RSS.

  1. Ya, Peter Ritchie is a great mentor! Very cool! I follow him too! :>

    re flicking vs clicking
    Very cool to see your app evolving! NICE! (And you too! haha) You said you have somethings for ver 2, but I can’t wait to see ver 1! Keep up the great work!

    phenry9999

    October 3, 2011 at 1:40 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: