Click or drag to resize

SpriteController Constructor (PictureBox, SpriteDatabase)

Create a sprite controller, specifying the picturebox on which the sprites will be displayed. You want to have the PictureBox already defined, and a background image already set for the PictureBox. This constructor also uses a SpriteDatabase, which loads sprite definitions at construction time, and has tools for making and storing sprites.

Namespace:  SpriteLibrary
Assembly:  SpriteLibrary (in SpriteLibrary.dll) Version: 1.0.0.6 (1.0.0.6)
Syntax
C#
public SpriteController(
	PictureBox Area,
	SpriteDatabase DatabaseToUse
)

Parameters

Area
Type: System.Windows.FormsPictureBox
The PictureBox. that the sprites will be drawn in
DatabaseToUse
Type: SpriteLibrarySpriteDatabase
A SpriteDatabase to use
Examples
This is an example of a Form class that defines a SpriteController. The MainDrawingArea is a PictureBox.
C#
public partial class ShootingFieldForm : Form
{
    public ShootingFieldForm()
    {
        InitializeComponent();
        MainDrawingArea.BackgroundImage = Properties.Resources.Background;
        MainDrawingArea.BackgroundImageLayout = ImageLayout.Stretch;
        MySpriteDatabase = new SpriteDatabase(Properties.Resources.ResourceManager, "MySpriteDefinitions");
        MySpriteController = new SpriteController(MainDrawingArea, MySpriteDatabase);
    }
}
See Also