1
Graphics / Displaying sf::String from a pointer
« on: May 17, 2010, 04:37:28 pm »
After installing 1.6 version all is ok.
This solution is correct. I test in my code.
This solution is correct. I test in my code.
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.
sf::Image Buffer(640,640);
...
for (int i=0;i<10;i++)
{
for (int j=0;j<10;j++)
{
TileMap[i][j].SetTileContainer(&TileSet); //My tileset TileMap[i][j].SetPosition(
i*(float)TileMap[i][j].GetTileContainer()->GetTileWidth(0),
j*(float)TileMap[i][j].GetTileContainer()->GetTileHeight(0)); TileMap[i][j].SetTile(tab_mapa[j][i]);
Buffer.Copy(
*TileMap[i][j].GetImage()
,(int)TileMap[i][j].GetPosition().x
,(int)TileMap[i][j].GetPosition().y
,TileMap[i][j].GetSubRect()
);
}
}
sf::Sprite Map_01;//Sprite part #1
sf::Sprite Map_02;//Sprite part #2
sf::Sprite Map_03;//Sprite part #3
sf::Sprite Map_04;//Sprite part #4
Map_01.SetImage(Buffer);
Map_01.SetPosition(0.0f,0.0f);
Map_02.SetImage(Buffer);
Map_02.SetPosition(640.0f,0.0f);
Map_03.SetImage(Buffer);
Map_03.SetPosition(0.0f,640.0f);
Map_04.SetImage(Buffer);
Map_04.SetPosition(640.0f,640.0f);
And in Loop…
...
App.Clear(sf::Color(255,255,255));
App.Draw(Map_01);
App.Draw(Map_02);
App.Draw(Map_03);
App.Draw(Map_04);
...