C # development Wpf/silverlight animation and games series Tutorials (Game Course): (31) Super Cool million vector magic
Remember that year's classic online games Miracle (MU)? Brilliance is as deep in my mind as its name. The days of fighting all night with my friends have become a thing of the past, leaving me with a memorable picture of the classic immortality of the world. Its success not only because it has a great world view, but also the deeper is those cool and gorgeous magic effect, once touched countless young hearts.
In this section, I'm going to show you how to make vector magic, modelled on the "laser" magic of the Marvel:
Do not know if this map can salvage the memories of the precipitation, this is the miracle of the same as the hell fire, one of the two great Magic: laser, beautiful picture and more importantly, it has a straight line penetration group attack effect. To imitate it, we can make a mock sketch from PS to learn the color and the gradual change of the magic picture, which will provide a reference for us to construct it later in Wpf/silverlight:
Using the gradient tool in PS to cooperate with the outer glow effect, we can easily create the above sketch, and then recall the previous content is not difficult to analyze in WPF we can draw a rounded rectangle and with a rainbow brush, and finally this rectangle to add a bitmap external light-emitting effect can achieve the above results. With the principle, it's easy to describe it in a XAML language. We first add a user control named Qxlaser to the project, and then set its XAML interface container code as follows:
……
<Canvas>
<Rectangle x:Name="Body" Width="700" Height="80" RadiusX="80" RadiusY="80">
<Rectangle.RenderTransform>
<RotateTransform x:Name="Rotate" />
</Rectangle.RenderTransform>
<Rectangle.BitmapEffect>
<OuterGlowBitmapEffect x:Name="Outer" GlowSize="40" Noise="0" Opacity="1" />
</Rectangle.BitmapEffect>
</Rectangle>
</Canvas>
……