Silverlight Game development tips: Silverlight programs with transparent backgrounds

Source: Internet
Author: User
Keywords Transparent background we tips
Tags applied data development find game game development name official

Some friends are playing litters world, discover the official Website entry entry program is Silverlight, but interesting is a transparent background Silverlight program, this effect I did not find the earliest data, in the future Silverlight program will be applied in all aspects, The effect of a transparent background is covered, and the effect is previewed as follows:

Here's a step-by-step technique to prepare a Silverlight and then set the mainpage fill to be transparent, as well as LayoutRoot, where I used a picture from the Web:

In order to stabilize, it is best to set the mainpage to death, which will help us to render in the Web page:

My picture is 256x256, you can set the size according to their own needs, but must meet the requirements of the final presentation.

Now we are on this, small do a few storyboard animation, such as mouse move into the move out, so that can better look at this effect, concrete implementation we do not do too many instructions, you can directly in the last download source project browsing.

Now we're going to integrate it into a Web page, and also, simply prepare a page with a background

Now we need to add Silverlight programs to the Web page:

<div>
<object data= "data:application/x-silverlight-2, type=" application/x-silverlight-2 "width=" height= "220" >
<param name= "source" value= "/clientbin/yousilverlight.xap"/>
<param name= "Windowless" value= "true"/>
<param name= "Background" value= "#0F00"/>
<param name= "minRuntimeVersion" value= "4.0.50401.0"/>
</object><iframe id= "_sl_historyframe" style= "visibility:hidden;height:0px;width:0px;border:0px" > </iframe>
</div>

Please write your Silverlight target in the source attribute, and you may notice that background this attribute, which sets a #0f00, which is a color representation field, a standard ARGB color value, and we have set A's color value to 0, Interested friends can learn about the Properties section of background: http://msdn.microsoft.com/zh-cn/library/cc838148 (vs.95). aspx

But if you run directly, you will get an effect that is not a transparent background, because now the Silverlight program is not a windowless mode at the moment, you need to set windowless to true, as described in the above code.

Related information can be queried http://msdn.microsoft.com/zh-cn/library/cc838156 (vs.95). aspx

The rest of the work you need a page designer to help you complete, such as where to show the program where the work,

So let's preview the effect. This is a combination of Web page skills, you can make such as login, banner, etc. need transparent background special effects program.

The source code of this project is downloaded as follows: Click to download directly

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.