It may wonder why a version 2nd is used. In fact, this is an improved version, which is easier to implement and more convenient, but the problem is also obvious, because a DLL of more than 100 KB will be added, any 1KB is a valuable resource for web games, and the XAP capacity will be increased for no reason for this small effect, it also proves that there is a sense of loss. How should I choose between fish and bear's paw? Let's first look at this implementation method.
The preceding method is almost the same, but the two grids do not need to be added. Instead, LayoutRoot is directly cropped with a Rect of the entire size,
Of course, if you like it, you can use Border or other containers as the background, add an image as the icon basemap, and then find the "Pie" Control in Asset.
You can know in the prompt that Microsoft. expression. drawing. dll, and this is the culprit. It will relentlessly enter the final release of XAP. Well, we will not tangle with this issue first, and proceed first.
Add to control
Expand the margin so that the slice arc will not leak out. By the way, we fill in a translucent black.
We set all Margin to-15. In the Pie control, StartAngle is the starting angle. I simply set 120, which is different from the previous one.
Now we have made storyboards in similar ways.
This is a simple animation. You can set StartAngle to 0 in 0 seconds and 2nd in 360 seconds. If you need different time lengths, you can make some adjustments.
In the previous article, I did not write the click code. In this article, we can modify the code based on our own needs. If we program UserControl, we can rewrite the Click Event of the mouse.
Code Snippet
- Public partial class SkillIcon: UserControl
- {
- Public SkillIcon ()
- {
- InitializeComponent ();
- }
- Protected override void OnMouseLeftButtonDown (MouseButtonEventArgs e)
- {
- ANI_CoolDown.Begin ();
- Base. OnMouseLeftButtonDown (e );
- }
- }
Actually, it is to execute Begin ()
In the following running effect, it is almost the same as the first one. Here we need to make a comparison and trade-offs to sacrifice the size for convenience, to reduce the production efficiency by KB (the actual compression may only be 50 KB. In fact, each method can be used, as long as we can implement our ideas.
Source code: Click to download directly