In file include/csengine/csspr2d.h:

## class csSprite2D : public csBase

> This class is a abstraction for simple 2D sprites

## Inheritance:

### Public Methods

  | csSprite2D (csTextureHandle *hTexture, int x, int y, int w, int h) Initialize the sprite from a texture.
  void | Draw (IGraphics2D* g2d, int sx, int sy) Draw the sprite without rescale
  virtual void | Draw (IGraphics2D* g2d, int sx, int sy, int sw, int sh) Draw the sprite given the screen position and size
  int | Height () Return sprite height
  bool | ok () Return true if sprite has been initialized okay
  void | SetTextureRectangle (int x, int y, int w, int h) Set new location of sprite image on texture
  int | Width () Return sprite width
  virtual | ~csSprite2D () Deinitialize the sprite

## Documentation

> This class is a abstraction for simple 2D sprites. Sprites can be drawn with a transparent key color as well as without transparent color. These sprites are slower relatively to run-length encoded sprites (see csSprite2D_RLE) but has the advantage that these sprites can be dynamically-scaled, while RLE-encoded cannot.

`csSprite2D(csTextureHandle *hTexture, int x, int y, int w, int h)`
  Initialize the sprite from a texture.

`virtual ~csSprite2D()`
  Deinitialize the sprite

`bool ok()`
  Return true if sprite has been initialized okay

`void SetTextureRectangle(int x, int y, int w, int h)`
  Set new location of sprite image on texture

`virtual void Draw(IGraphics2D* g2d, int sx, int sy, int sw, int sh)`
  Draw the sprite given the screen position and size

`void Draw(IGraphics2D* g2d, int sx, int sy)`
  Draw the sprite without rescale

`int Width()`
  Return sprite width

`int Height()`
  Return sprite height

This class has no child classes.

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de