added TileMaps to TSE
This commit is contained in:
@@ -33,3 +33,24 @@ void TSE::TileSet::GetSpriteAt(int x, int y, Sprite &s)
|
||||
|
||||
s = Sprite(tex, Rect(startpos, endpos));
|
||||
}
|
||||
|
||||
int TSE::TileSet::GetSpriteIdAt(int x, int y)
|
||||
{
|
||||
if(x < 0 || x >= resx || y < 0 || y >= resy)
|
||||
{
|
||||
TSE_ERROR("The sprite you are trying to access is out of range");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return y * resx + x;
|
||||
}
|
||||
|
||||
uint TSE::TileSet::GetTextueID()
|
||||
{
|
||||
return tex->GetTextureId();
|
||||
}
|
||||
|
||||
TSE::Vector2 TSE::TileSet::GetCount()
|
||||
{
|
||||
return Vector2(resx, resy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user