Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Messages - Daiky

Pages: [1]
1
Graphics / Re: beginner problem MapRenderer
« on: June 07, 2013, 09:12:36 pm »
I changed this line of code (line 194 of the C++ tutorial):

rt.draw(&vertices[0], vertices.size(), sf::PrimitiveType::Quads);

into this:

rt.draw(&vertices[0], vertices.size(), sf::PrimitiveType::Quads, states);

and now it works.... If this is wrong in the tutorial, it probably should be fixed, or it might keep beginners like me searching for a while on the reason why their tilemap texture is not showing.

2
Graphics / beginner problem MapRenderer
« on: June 06, 2013, 10:49:42 am »
Hello,
I'm just starting with SFML (I have 4 years experience with SDL and 20 years with C++) with plans to create a simple tile based 2D game.

So I took the C++ version of MapRenderer: https://github.com/SFML/SFML/wiki/Source%3A-TileMap-Render to have  a starting point.

I have a tileset of 64x64 tiles called tileset.png. So I figured if I replaced the following things:
default tileSize  --> tileSize=64,
texture.create(1,1); --> texture.loadFromFile("tileset.png");
src = IntRect(0,0,1,1); --> src = IntRect(0,0,64,64);
In the provider function I've put in comment the part where the color is set.

I would see my first tile to be drawn over the creen, but I just get a blank/black screen. I must be missing something obvious, but I'm probably looking over it everytime...
The texture loads fine...


Pages: [1]