7 vector<Tile>
Tileset::create(
string name,
string img, SDL_Renderer* ren,
int width,
int height,
int r,
int count) {
8 create(1, name, img, ren, width, height, r, count);
11 vector<Tile>
Tileset::create(
string name,
string img, SDL_Renderer* ren,
int width,
int height,
int r,
int rcount,
int count) {
12 create(1, name, img, ren, width, height, r, rcount, count);
15 vector<Tile>
Tileset::create(
int startid,
string name,
string img, SDL_Renderer* ren,
int width,
int height,
int r,
int count) {
16 create(startid, name, img, ren, width, height, r, count, count);
19 vector<Tile>
Tileset::create(
int startid,
string name,
string img, SDL_Renderer* ren,
int width,
int height,
int r,
int rcount,
int count) {
21 for(
int i=0; i<r; i++) {
22 for(
int j=0; j<rcount; j++) {
23 addTile(name, img, ren, tag+startid, i+1, j+1, width, height);
25 if(tag>count) {
break; }
35 Tile Tileset::addTile(
string name,
string file, SDL_Renderer* ren,
int value,
int c,
int r,
int width,
int height) {
38 tmp.
setFrame(((r-1)*width), ((c-1)*height), width, height);
39 tmp.setDestSize(width, height);
40 tmp.setPosSize(width, height);
47 Tile tmp =
addTile(name, file, ren, value, 1, value, width, height);
51 Tile tmp =
addTile(name, file, ren, value, 1, value, size, size);
56 for(
int i=0; i<tiles.size(); i++) {
57 tiles[i].setAngle(ang);
61 void Tileset::setSolid() {
62 setSolid(1, tiles.size()+1);
64 void Tileset::setSolid(
int t) {
67 void Tileset::setSolid(
int s,
int e) {
68 for(
int i=s; i<(e+1); i++) {
73 void Tileset::setPassable() {
74 setPassable(1, tiles.size()+1);
76 void Tileset::setPassable(
int t) {
77 tiles[t].setPassable();
79 void Tileset::setPassable(
int s,
int e) {
80 for(
int i=s; i<(e+1); i++) {
85 void Tileset::setName(
string n,
int id) {
void setImage(Image i)
Set the Object's Image with a given Image.
void setValue(int v)
Set value of the tile. This is used when reading from a map file, etc.
void setFrame(SDL_Rect i)
Set the frame with a given SDL_Rect.
vector< Tile > create(string name, string img, SDL_Renderer *ren, int width, int height, int r, int count)
Load in a map file with the name for all the tiles, the path to the map file, path to the tileset ima...
void addTile(Tile t)
Push Tile in tile with given Tile.
An Object class that stores the a tile value and name.
void setAngle(int ang)
Set the angle of all the tiles. Calls pushAng().