SpriteLibrary
SpriteLibrary
SpriteLibrary
SpriteController Class
SpriteController Constructor
SpriteController Constructor (PictureBox)
SpriteController Constructor (PictureBox, SpriteDatabase)
SpriteController Constructor (PictureBox, EventHandler)

# 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#
Copy

    public SpriteController(
    	PictureBox Area,
    	SpriteDatabase DatabaseToUse
    )

#### Parameters

Area
  Type: System.Windows.Forms
  PictureBox
  The PictureBox. that the sprites will be drawn in
DatabaseToUse
  Type: SpriteLibrary
  SpriteDatabase
  A SpriteDatabase to use

Examples
This is an example of a Form class that defines a SpriteController. The MainDrawingArea is a PictureBox.
C#
Copy

    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

#### Reference

SpriteController Class
SpriteController Overload
SpriteLibrary Namespace