106
Graphics / Re: Loading tile maps
« on: August 12, 2013, 12:35:45 pm »Quote
@ lockandstrike
Thanks, I'll then focus on the intermediate and hard ones.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
@ lockandstrike
Thanks, I'll then focus on the intermediate and hard ones.
@Ixrec
http://www.sfml-dev.org/tutorials/2.1/graphics-sprite.php#the-white-square-problem
In this specific case, it looks like you're trying to read the string "Map.png" from the file "Map.txt", but the Map.txt you've posted doesn't contain the string "Map.png". Did you leave part of it out?
Also, you should probably do error checking on the loadFromFile call:if( !tileTexture.loadFromFile(tileLocation) )
//output an error message of some kind or simply exit the program
@binary1248
No, it is a bit more involved than that. Look for a guide, it's too much to explain here.
@binary1248
So.... what happens when you debug it? If you don't know how to debug your application in Code::Blocks, I'm sure you'll be able to find another tutorial for that...
@The Hatchet
Did you remember to move the DLL files over to your working directory as well? These are needed if you link the dynamic version vs static.
@lockandstrike
It's already been said, but in your code, where there is a "if(GameWindow.pollEvent(GameEvent))" statement there should be a "while(GameWindow.pollEvent(GameEvent))" statement. Change the code and post the result of that.
Sounds like you have compiler/linker settings messed up somewhere. Are you sure your not mixing debug and release and that you have the correct libs for your compiler?
Maybe if you posted why the code doesn't compile we might be able to help you. Just saying code doesn't compile without any error message of any sort won't help you out.