Compartir a través de


Sprite Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Provides methods and properties that simplify the process of drawing sprites using Direct3D.

Namespace:  Microsoft.WindowsMobile.DirectX.Direct3D
Assembly:  Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)

Syntax

'Declaration
Public NotInheritable Class Sprite _
    Implements IDisposable
'Usage
Dim instance As Sprite
public sealed class Sprite : IDisposable
public ref class Sprite sealed : IDisposable
[<SealedAttribute>]
type Sprite =  
    class
        interface IDisposable
    end

Remarks

A sprite is a texture mapped to a 2-D surface. Typically used for animation and billboarding, since multiple sprites can move within a larger image.

Typically, the application first calls Begin, which allows control over the device render state, alpha blending, and sprite transformation and sorting. Then, for each sprite to display, the application calls Draw, which can be called repeatedly to store any number of sprites. To display the batched sprites to the device, the application calls End or Flush.

Topic Location
How to: Use Sprites .NET Compact Framework
How to: Use Sprites .NET Compact Framework
How to: Use Sprites .NET Compact Framework
How to: Use Sprites .NET Compact Framework

Examples

The following code example shows how to create a sprite. For more information about creating and using sprites see How to: Use Sprites.

present = New PresentParameters()
present.BackBufferCount = 1
present.BackBufferFormat = dispmode.Format
present.BackBufferHeight = dispmode.Height
present.BackBufferWidth = dispmode.Width
present.SwapEffect = SwapEffect.Discard
device = New Device(Manager.Adapters.Default.Adapter, DeviceType.Default, Me, CreateFlags.None, present)
sprite = New Microsoft.WindowsMobile.DirectX.Direct3D.Sprite(device)

present = new PresentParameters();
present.BackBufferCount = 1;
present.BackBufferFormat = dispmode.Format;
present.BackBufferHeight = dispmode.Height;
present.BackBufferWidth = dispmode.Width;
present.SwapEffect = SwapEffect.Discard;

device = new Device(Manager.Adapters.Default.Adapter, DeviceType.Default, this, CreateFlags.None, present);
sprite = new Microsoft.WindowsMobile.DirectX.Direct3D.Sprite(device);

Inheritance Hierarchy

System.Object
  Microsoft.WindowsMobile.DirectX.Direct3D.Sprite

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Compact Framework

Supported in: 3.5, 2.0

See Also

Reference

Sprite Members

Microsoft.WindowsMobile.DirectX.Direct3D Namespace

Other Resources

Mobile Direct3D Programming in the .NET Compact Framework

How to: Use Sprites