How to draw an arc in winRT with animation?

后端 未结 4 2053
梦毁少年i
梦毁少年i 2021-01-03 02:43

I am a newbie to WinRT and Blend and I need to draw digits 1, 2 etc with drawing effect in my WinRT application. The requirement is like the application will be drawing the

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-03 03:21

    I think you would need to piece together a couple of storyboards to achieve that, and I would really recommend that you use Blend for that!

    Open a blank project, under objects and timeline there is a plus, click on it and add a new story board. Move the yellow bar of the storyboard line a few milliseconds forward. Draw a piece of the animation , click start recording and move that piece a little bit. Stop recording. Keep doing that piece by piece until you have what you want. AS for imitating drawing. Break down how you you want it to be, make all the separate pieces the digit will consist of and set their opacity to O. I would recommend using both keyframe (for movement) and double animation for the opacity.

    Here is a quick demo of a piece of path following a curved line, I made this really fast so it's far away from perfect, but it's to demonstrate the start and stop and how they look together:

    
    
        
            
                
                
                
                
                
                
                
                
                
            
            
                
                
                
                
                
                
                
                
                
            
        
    
    
    
        
        
            
                
                    
                        
                    
                
            
        
    
    

    Here is an image of how it looks like, its the yellow thing that moves - the curved movement is just an example to show you can piece together to create any movement you want. Something called easing function can even do this for you, see image below. Here is an image of how it looks like, its the yellow thing that moves - the curved movement is just an example to show you can piece together to create any movement you want. Something called easing function can even do this for you, see image below.

    Here are easing functions available, play around with them, in combination with the items in the storyboard to create the desired effect. Here are easing functions available, play around with them, in combination with the items in the storyboard to create the desired effect.

    The different easing functions are well explained here on MSDN

    There is no double animation in the examples above, but they look like this:

     
                            
                        
    

    It's a big job, and will take time. And I would recommend that you sit down and learn how to use Blend and work with storyboards before you do that. There are many great tutorials out there, and it will be worth the time. Personally I tend to let a designer help out with the animations, as you might see in the storyboard above, I'm not a pro at animations - there is a lot to keep in mind, in particular in regards to the app performance.

    I would also like to point out some of the main ideas behind the Modern UI , the required design language for Windows Store Apps, and that is to stay authentically digital. The app should not mimic real life things, makes no sense as it is an app and not 'reality'.

    From MSDN: Be authentically digital Take full advantage of the digital medium. Remove physical boundaries to create experiences that are more efficient and effortless than reality. Embrace the fact that we are pixels on a screen. Design with bold, vibrant and crisp colors and images that go beyond the limits of real world material.

    Video worth watching: http://channel9.msdn.com/Events/Ch9Live/Channel-9-Live-at-Tech-Ed-Europe-2012/Panel-Modern-UI-Development

    So think about that, and maybe you don't need a drawing motion. Maybe just a quick fade in, like so:

    
    
        
            
                
                
            
        
    
    
    
        
    
    

提交回复
热议问题