November 2008 - Posts
For this tutorial we will be generating a 2D scrolling map. The view is a straight down birds eye view. As shown in Figure 1 below, each terrain tile is represented by a combine upper-left and lower-right polygon. A map can be any width and height of
Read More...
Let’s say you have a class where you want to declare elements via a XAML template instead of dynamically creating them. For example, the XAML to declare an image and add it to a canvas would look like this: <Canvas x:Name= "MyCanvas" >
Read More...
Silverlight currently does not support mouse wheel events. However, you can attach an event to capture the mouse wheel movement through the HtmlPage object. This tutorial will show you how to do it for IE, Opera, Mozilla and Safari browsers. To start,
Read More...
No game is complete without a great sound track and sound effects! This tutorial will show you how to do both with a very small amount of code. Demo: (Silverlight 2 RTW required). Silverlight currently supports the following formats: Video WMV1-3 (Windows
Read More...
Shapes, gradients and brushes provide the user with a lot of power to make custom controls that look beautiful. For example, gradients can be made to look like shadows or lighting for stunning visual effects. For this demo, we are going to make the beginnings
Read More...
Each application by default is given 1 MB of storage space through Isolated Storage where the server is able to store client specific data on the clients machine. So what if you need more than 1 MB? Fortunately, the IsolatedStorageFile object provides
Read More...
Silverlight uses Isolated Storage as a virtual file system to store data in a hidden folder on your machine. It breaks up the data into two separate sections: Section #1 contains administrative information such as disk quota and section #2 contains the
Read More...
Cookies are strings of text that the server can store on the client side. These cookies can then be sent back by the client to the server each time the client accesses that server again. Cookies are commonly used for session tracking, authentication,
Read More...
Each Silverlight element exposes a property called RenderTransform that is used to set the transform information that affects the rendering position of the element. I will be demo’ing a non-stop circular transform rotation of an image as seen here below:
Read More...
In Tip of the Day #5 I discussed how to use the DispatcherTimer for your main game loop. However, a better approach may be to use the StoryBoard timer as discussed here or the CompositionTarget.Rendering event which was recently added to Silverlight 2.
Read More...
Communicating between Javascript and Silverlight is, fortunately, relatively straight forward. The following sample demonstrates how to make the call both ways. Calling Silverlight From Java script: In the constructor of your Silverlight app, make a call
Read More...
You may have noticed that right clicking on a Silverlight application brings up the following context menu and configuration dialog: Context Menu: Configuration Dialog: So what if you want to use right click in your application? While right click functionality
Read More...
Since Silverlight is based upon an asynchronized model, getting an image width and height immediately after loading it is not possible. However, you can monitor its download progress and obtain the image dimensions once the progress has reached 100%.
Read More...
Before a Silverlight application can connect to a server it must first successfully connect to a policy server on that machine in order to proceed with the connection. In this tip I will take you through every step you need to create and run your own
Read More...
[Blog Mirrored from http://silverlight.net/blogs/msnow/default.aspx ] In order to make your Silverlight control transparent to the background of your web site you have to do two things. From an ASPX page: Add the tag PluginBackground ="Transparent"
Read More...
[Blog Mirrored from http://silverlight.net/blogs/msnow/default.aspx ] Loading images in Silverlight is fairly straight forward. The first step is to create what’s called a Uniform Resource Identifier (URI). The URI is essentially a string that points
Read More...
[Blog Mirrored from http://silverlight.net/blogs/msnow/default.aspx ] For this tutorial, I will be showing you how to capture the size of your browser when it is resized. This is essential if you want to align your elements to the browsers borders, center
Read More...
[Blog Mirrored from http://silverlight.net/blogs/msnow/default.aspx ] The following is my list of Silverlight Resources including blogs, tutorials and more. If you know of any other good ones please let me know as I will keep this list updated on a regular
Read More...
[Blog Mirrored from http://silverlight.net/blogs/msnow/default.aspx ] With GIF's, which aren’t supported in Silverlight2, transparency is fairly easy because you can just specify what color in that GIF you want to be your transparent color. With PNG's,
Read More...
[Blog Mirrored from http://silverlight.net/blogs/msnow/default.aspx ] Silverlight 2 provides full support for keyboard and mouse event handling. Not only can you monitor events for the entire application but you can also monitor them at the individual
Read More...
Main Game Loop [Blog Mirrored from http://silverlight.net/blogs/msnow/default.aspx ] The main game loop is the heart of your game. In this function you will execute the majority of your game related tasks including: Game AI Animations - Updating objects
Read More...
[Blog Mirrored from http://silverlight.net/blogs/msnow/default.aspx ] Silverlight provides a <Grid> control that makes it very easy to plan and layout the user interface for your game. This control also supports imbedding grids within grids similar
Read More...
[Blog Mirrored from http://silverlight.net/blogs/msnow/default.aspx ] While exploring techniques for game programming with Silverlight I came across some hurdles and discovered some workarounds. I plan to use this blog to track these issues for the purposing
Read More...
[Blog Mirrored from http://silverlight.net/blogs/msnow/default.aspx ] To start, let's create a new Silverlight Application in Visual Studio 2008! To do this, from the menu select File | New | Project as seen in Figure 1.1. If you wish to program in C#
Read More...
[Blog Mirrored from http://silverlight.net/blogs/msnow/default.aspx ] Silverlight Tools is an add-on package that will allow you to develop Silverlight application using Visual Studio 2008 SP1. Click this link to install: Install Silverlight Tools RTM
Read More...