1
Graphics / Problems with Tile displaying
« on: January 11, 2012, 02:18:03 pm »
Hello,
i want to draw a tile from my tilemap on screen, but other tiles (like a half black half red over it) bleed into my drawing tile.
what should i do?
Code:
i want to draw a tile from my tilemap on screen, but other tiles (like a half black half red over it) bleed into my drawing tile.
what should i do?
Code:
Code: [Select]
sf::RenderWindow _mainWindow;
_mainWindow.Create(sf::VideoMode(800,600,32),"test", sf::Style::Close );
_mainWindow.Draw(sf::Shape::Rectangle(0, 0, _mainWindow.GetWidth(), _mainWindow.GetHeight(), sf::Color(0xff,0xff,0xff)));
sf::Image image;
image.LoadFromFile("image.bmp");
sf::Sprite sprite(image);
for(int i = 0; i<10; i++)
{
int posX = 60;
int posY = 60;
int X = 0;
int Y = 1;
sf::IntRect Rect(posX*X,posY*Y,posX*X+posX,posY*Y+posY);
sprite.SetSubRect(Rect);
sprite.SetX(60);
sprite.SetY(i*60+20);
_mainWindow.Draw(sprite);
}
_mainWindow.Display();