sfTiledBackground Class Reference

#include <TiledBackground.hpp>

Inheritance diagram for sfTiledBackground:

sfDrawable sfVideoResource sfNonCopyable List of all members.

Public Member Functions

 sfTiledBackground ()
 sfTiledBackground (const sfImage &Img, unsigned int TileSize, unsigned int NbTilesX, unsigned int NbTilesY)
 ~sfTiledBackground ()
void Initialize (const sfImage &Img, unsigned int TileSize, unsigned int NbTilesX, unsigned int NbTilesY)
void SetTile (unsigned int PosX, unsigned int PosY, unsigned int IndexX, unsigned int IndexY)
void SetPosition (float Left, float Top)
void SetScale (float Scale)

Protected Member Functions

virtual void Render (sfRenderWindow &Window)

Classes

struct  Tile

Detailed Description

sfTiledBackground defines a static background, made of tiles. The purpose of this class is to provide an easy and optimized way to manage backgrounds

Definition at line 43 of file TiledBackground.hpp.


Constructor & Destructor Documentation

sfTiledBackground::sfTiledBackground (  ) 

Default constructor

Definition at line 38 of file TiledBackground.cpp.

sfTiledBackground::sfTiledBackground ( const sfImage Img,
unsigned int  TileSize,
unsigned int  NbTilesX,
unsigned int  NbTilesY 
)

Construct the background

Parameters:
Img : Image to use as a tileset
TileSize : Size of tiles, in pixels
NbTilesX : Background width, in number of tiles
NbTilesY : Background height, in number of tiles

Definition at line 57 of file TiledBackground.cpp.

References Initialize().

sfTiledBackground::~sfTiledBackground (  ) 

Destructor

Definition at line 76 of file TiledBackground.cpp.


Member Function Documentation

void sfTiledBackground::Initialize ( const sfImage Img,
unsigned int  TileSize,
unsigned int  NbTilesX,
unsigned int  NbTilesY 
)

Initialize background parameters

Parameters:
Img : Image to use as a tileset
TileSize : Size of tiles, in pixels
NbTilesX : Background width, in number of tiles (0 by default)
NbTilesY : Background height, in number of tiles (0 by default)

Definition at line 99 of file TiledBackground.cpp.

Referenced by sfTiledBackground().

void sfTiledBackground::SetTile ( unsigned int  PosX,
unsigned int  PosY,
unsigned int  IndexX,
unsigned int  IndexY 
)

Setup a tile

Parameters:
PosX : X coordinate of tile to set
PosY : Y coordinate of tile to set
IndexX : X index of tile in tileset
IndexY : Y index of tile in tileset

Definition at line 114 of file TiledBackground.cpp.

void sfTiledBackground::SetPosition ( float  Left,
float  Top 
)

Change background position

Parameters:
Left : New left coordinate
Top : New top coordinate

Definition at line 134 of file TiledBackground.cpp.

void sfTiledBackground::SetScale ( float  Scale  ) 

Change background scale

Parameters:
Scale : New scale (must be strictly positive)

Definition at line 145 of file TiledBackground.cpp.

void sfTiledBackground::Render ( sfRenderWindow Window  )  [protected, virtual]

/see sfDrawable::Render

Implements sfDrawable.

Definition at line 85 of file TiledBackground.cpp.


The documentation for this class was generated from the following files:
Generated for SFML by  doxygen 1.5.2