Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::gfx::Tile Class Reference

This class store tiles data for TileTexture class. More...

#include <Tile.h>

Inheritance diagram for kge::gfx::Tile:
kge::KgeUnknown

Public Member Functions

 Tile ()
 Constructor.
 ~Tile ()
 Destructor.
bool CreateTile (const char *pFileName, TileType eTileType, int NumCols, int NumRows, const char *name="TileClass")
 Create the tile data and load its image tile.
void CreateTile (int Width, int Height, TileType eTileType, int NumCols, int NumRows)
 Create the tile data. It's good for created tile textures.
math::Vector GetTile (int Col, int Row)
 Returns the tile texcoords.
void SetOffsets (float UOffset, float VOffset)
 Sets the U & V offset. this function is used by TileTexture Class.
void SetUV (float U, float V)
void SetPosition (int X, int Y)
 Sets the tile position in the tile texture class.
int GetX ()
 returns the image x position in the tile texture
int GetY ()
 Returns the image y position in the tile texture.
int GetWidth ()
 Returns the image Width.
int GetHeight ()
 Returns the image Height.
ImageGetImage ()
 Returns the tile Image.
void SetTotalCellsNumber (int ColCount, int RowCount)
- Public Member Functions inherited from kge::KgeUnknown
 KgeUnknown ()
 Constructor.
virtual ~KgeUnknown ()
 Destructor.
virtual void AddRef ()
 Add a reference to the object.
virtual void DecRef ()
 Decrease a reference from the object. if its reference count get 0 then the object will destroy.
u32 GetRefCount ()
 Return resource reference count.
const char * GetDebugText ()
 returns the instance debug text.

Protected Attributes

int m_iWidth
int m_iHeight
int m_iX
int m_iY
int m_iNumCols
int m_iNumRows
int m_iTotalCols
int m_iTotalRows
float m_fU
float m_fV
float m_fUOffset
float m_fVOffset
TileType m_eTileType
Imagem_pImage

Additional Inherited Members

- Protected Member Functions inherited from kge::KgeUnknown
void SetDebugText (char *text)

Detailed Description

This class store tiles data for TileTexture class.

Definition at line 33 of file Tile.h.

Constructor & Destructor Documentation

kge::gfx::Tile::Tile ( )

Constructor.

kge::gfx::Tile::~Tile ( )

Destructor.

Member Function Documentation

bool kge::gfx::Tile::CreateTile ( const char *  pFileName,
TileType  eTileType,
int  NumCols,
int  NumRows,
const char *  name = "TileClass" 
)

Create the tile data and load its image tile.

void kge::gfx::Tile::CreateTile ( int  Width,
int  Height,
TileType  eTileType,
int  NumCols,
int  NumRows 
)

Create the tile data. It's good for created tile textures.

int kge::gfx::Tile::GetHeight ( )
inline

Returns the image Height.

Definition at line 107 of file Tile.h.

Image* kge::gfx::Tile::GetImage ( )
inline

Returns the tile Image.

Definition at line 110 of file Tile.h.

math::Vector kge::gfx::Tile::GetTile ( int  Col,
int  Row 
)

Returns the tile texcoords.

int kge::gfx::Tile::GetWidth ( )
inline

Returns the image Width.

Definition at line 104 of file Tile.h.

int kge::gfx::Tile::GetX ( )
inline

returns the image x position in the tile texture

Definition at line 98 of file Tile.h.

int kge::gfx::Tile::GetY ( )
inline

Returns the image y position in the tile texture.

Definition at line 101 of file Tile.h.

void kge::gfx::Tile::SetOffsets ( float  UOffset,
float  VOffset 
)
inline

Sets the U & V offset. this function is used by TileTexture Class.

Definition at line 76 of file Tile.h.

void kge::gfx::Tile::SetPosition ( int  X,
int  Y 
)
inline

Sets the tile position in the tile texture class.

Definition at line 90 of file Tile.h.

void kge::gfx::Tile::SetTotalCellsNumber ( int  ColCount,
int  RowCount 
)
inline

Definition at line 113 of file Tile.h.

void kge::gfx::Tile::SetUV ( float  U,
float  V 
)
inline

Definition at line 82 of file Tile.h.

Member Data Documentation

TileType kge::gfx::Tile::m_eTileType
protected

Definition at line 132 of file Tile.h.

float kge::gfx::Tile::m_fU
protected

Definition at line 128 of file Tile.h.

float kge::gfx::Tile::m_fUOffset
protected

Definition at line 128 of file Tile.h.

float kge::gfx::Tile::m_fV
protected

Definition at line 128 of file Tile.h.

float kge::gfx::Tile::m_fVOffset
protected

Definition at line 128 of file Tile.h.

int kge::gfx::Tile::m_iHeight
protected

Definition at line 120 of file Tile.h.

int kge::gfx::Tile::m_iNumCols
protected

Definition at line 120 of file Tile.h.

int kge::gfx::Tile::m_iNumRows
protected

Definition at line 120 of file Tile.h.

int kge::gfx::Tile::m_iTotalCols
protected

Definition at line 120 of file Tile.h.

int kge::gfx::Tile::m_iTotalRows
protected

Definition at line 120 of file Tile.h.

int kge::gfx::Tile::m_iWidth
protected

Definition at line 120 of file Tile.h.

int kge::gfx::Tile::m_iX
protected

Definition at line 120 of file Tile.h.

int kge::gfx::Tile::m_iY
protected

Definition at line 120 of file Tile.h.

Image* kge::gfx::Tile::m_pImage
protected

Definition at line 133 of file Tile.h.


The documentation for this class was generated from the following file: