SpriteLibrary

Sprite Fields

The Sprite type exposes the following members.

Fields

| Name | Description
--- | --- | ---
| CannotMoveOutsideBox | Determine if the sprite will automatically move outside the box. If not, it will hit the side of the box and stick
| MirrorHorizontally | Flip the image when it gets printed. If your sprite is walking left, flipping it will make it look like it is going right. This works great for many things. But, if your program is gobbling memory or CPU, you may need to consider using Sprite.AddAnimation
| MirrorVertically | Flip the image when it gets printed. If your sprite looks like it is facing up, doing this will make it look like it faces down. This works great for many things. But, if your program is gobbling memory or CPU, you may need to consider using Sprite.AddAnimation

MovementSpeed

The movement speed of the sprite. To make a Sprite move, you need to set the MovementSpeed, the direction (using SetSpriteDirection(Vector), SetSpriteDirectionToPoint(Point), SetSpriteDirectionRadians(Double), or SetSpriteDirectionDegrees(Double)), and the AutomaticallyMoves property. The speed is calculated in pixels per amount of time. A higher number is faster than a lower number.

payload

A Sprite can hold a payload. Use this to store extra information about the various Sprites. Health, Armor, Shoot time, etc. But, to store information in the payload, you need to make a new class of SpritePayload. The syntax for doing so is:
Copy

    public class TankPayload : SpritePayload {  public int Armor; public int Speed; }

You can access the payload and retrieve the various values.

Top
See Also

#### Reference

Sprite Class
SpriteLibrary Namespace