PlayerIO

The fastest way to build online games without breaking a sweat.

Multiplayer Reference

Multiplayer  class documentationClass EmbeddedResource

Namespace: PlayerIO.GameLibrary
Language: C# / .NET

A simple class to access resources embedded into the game assembly (.dll file).

This class is useful along with the Game.GenerateDebugImage() method, because it allows you to grab embedded images and use them when rendering the debug image.

To embed a file into the game assembly, add it to the project, right-click it in the solution explorer and choose Properties. In the properties pane, change the Build Action to Embedded Resource. The next time you build your solution that file will be copied into the assembly, and accessible through this class.

Example

Using the debug visualization system to generate a new debug image every second, and draw an image embedded as an embedded resource from the .dll file onto the debug image.

Methods

 
public Byte[]
GetBytes (string filename)

Get the bytes[] of an embedded resource.

public Image
GetImage (string filename)

Get an embedded resource as an image.

EmbeddedResource.GetBytes

public Byte[]
GetBytes (string filename)

Get the bytes[] of an embedded resource.

Arguments

string filename
The suffix of the embedded filename to search for.

EmbeddedResource.GetImage

public Image
GetImage (string filename)

Get an embedded resource as an image.

Arguments

string filename
The suffix of the embedded filename to search for.