7 lines
222 B
C++
7 lines
222 B
C++
|
#include "IndexTexture.h"
|
||
|
|
||
|
sf::IntRect IndexTexture::spriteCoordinates(int index) {
|
||
|
int tx = index % grid_width, ty = index / grid_width;
|
||
|
return sf::IntRect(tx * grid_size, ty * grid_size, grid_size, grid_size);
|
||
|
}
|