Jump to content
  • Advertisement
Sign in to follow this  
SoulHeart

How to set drawing bounds for a sfml tiled map loader

This topic is 2285 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How would I set drawing bounds for this tiled map editor...
http://www.sfml-dev.org/forum/viewtopic.php?p=43028&sid=64293e259add28a8092157afef619735

This is the example that was in the readme 
level.SetDrawingBounds(somesfview.GetRect()) 

I'm not sure what to put in for "somesfview"

Share this post


Link to post
Share on other sites
Advertisement
ok I got it to load and build without errors, but when I run the program the console says "Bad map. No tile information found" I know however, that the map isn't blank. Does anyone know why it is telling me this?

Share this post


Link to post
Share on other sites

Level map1;
map1.LoadFromFile("MapTest1.tmx");
sf::View View1(sf::FloatRect(0, 0, 1000, 1000));
map1.SetDrawingBounds(View1.GetRect());
map1.Draw(window4);


And no the console doesn't say anything else. I know that the map and tile sheet is loading correctly though. Maybe it has to do with the drawing bounds???

Share this post


Link to post
Share on other sites
After examining the code and what you posted, my thought is that it is crashing because layerDataElement is pointing to NULL (the if test where you get your message). Perhaps you have some problems in the file? Or it has a blank layer that it is trying to load? Can you grab a file that definitely works, say an example file from the guy that made it?

Share this post


Link to post
Share on other sites
I had the same problem that you have,

Before exporting the .tmx file first go to "Edit" >> "Preferences"
and open the first dropdown box: "Store tile layer data as:"
and change it to xml.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!