Click or drag to resize
DigitalRuneImageSprite Class
Represents a 2D bitmap rendered in screen space.
Inheritance Hierarchy

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public class ImageSprite : Sprite

The ImageSprite type exposes the following members.

Constructors
  NameDescription
Public methodImageSprite
Initializes a new instance of the ImageSprite class.
Public methodImageSprite(PackedTexture)
Initializes a new instance of the ImageSprite class with the specified texture.
Top
Methods
  NameDescription
Public methodClone
Creates a new Sprite that is a clone (deep copy) of the current instance.
Protected methodCloneCore
Makes the instance a clone (deep copy) of the specified Sprite.
(Overrides SpriteCloneCore(Sprite).)
Protected methodCreateInstanceCore
When implemented in a derived class, creates a new instance of the Sprite derived class.
(Overrides SpriteCreateInstanceCore.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyName
Gets or sets the name of the sprite.
(Inherited from Sprite.)
Public propertyTexture
Gets or sets the texture.
Top
Remarks

A sprite is a 2D image, such as a bitmap or a text. Sprites are positioned in world space, but rendered in screen space. That means, a 16x16 pixel sprite is usually exactly 16x16 pixel on screen. (Internally the images and texts are rendered using the XNA SpriteBatch, hence the name.)

DigitalRune Graphics supports two types of sprites:

  • ImageSprite ... static or animated bitmap
  • TextSprite ... text using a bitmap font

A sprite is positioned in world space by creating a new SpriteNode and adding it to a 3D scene.

Cloning:
Sprites are cloneable. Clone creates a copy of the current sprite. The Texture of a ImageSprite or the Text of a TextSprite is copied by reference (no deep copy).

See Also