SFML community forums

Help => Graphics => Topic started by: Stock on June 03, 2014, 04:47:29 pm

Title: How do I organize my Tileset based on the Tile Map example
Post by: Stock on June 03, 2014, 04:47:29 pm
So I have a Tilemap, and it works... if I am only loading one Tile. As soon as I try to load more than one(Example 1 results in only one, very distorted, tile loading      Example 2 results in crash), it doesn't work.

Here are two ways I thought would work, but aren't for me... any ideas?

Code: [Select]
//Load First Tile
if (!Map.Load("Tile Location", Vector2u(32, 32), Level, 16, 16))
    return -1;

//Load Second Tile
if (!Map.Load("Tile2 Location", Vector2u(32, 32), Level, 16, 16))
    return -1;

Code: [Select]
//Load 1 Tile sheet, 256x256                   //I Have also tried 256, 256 here
if (!Map.Load("Tileset Location", Vector2u(                           32, 32), Level, 16, 16))
    return -1;
Title: Re: How do I organize my Tileset based on the Tile Map example
Post by: Nexus on June 03, 2014, 04:59:39 pm
What is your Map class? It can't be the one from the tutorial since it has an uppercase Load() function... which leads to the question what else is different in your code.

In general, you will get better help if you read the forum rules before posting, especially this part (http://en.sfml-dev.org/forums/index.php?topic=5559.msg36368#msg36368). You should at least stick to the original TileMap code so we can exclude the possibility that your implementation contains bugs.

Are you sure that the other parameters are meaningful? Have you checked the size of Level and the last two arguments, do they match? Which image file are you using?
Title: Re: How do I organize my Tileset based on the Tile Map example
Post by: Stock on June 04, 2014, 12:38:38 am
Ok, I updated the code now, it is the one from the tutorial exactly now, nothing changed...

As far as I can tell, I did a fairly good job following those guide lines... a few mistakes though...

Yes. Yes Levels size and the two args match. PNG.