Click or drag to resize
DigitalRuneTextSprite Class
Represents a 2D text 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 TextSprite : Sprite

The TextSprite type exposes the following members.

Constructors
  NameDescription
Public methodTextSprite
Initializes a new instance of the TextSprite class.
Public methodTextSprite(Object, SpriteFont)
Initializes a new instance of the TextSprite class.
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 propertyFont
Gets or sets the font.
Public propertyName
Gets or sets the name of the sprite.
(Inherited from Sprite.)
Public propertyText
Gets or sets the text. See remarks.
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