SFML community forums
Help => Graphics => Topic started by: croux on March 26, 2014, 07:24:37 pm
-
Hi,
i am using one sprite to display multiple textures.
First is rocket and second is little bullet.
The problem is, that displayed image is changing width and height during displaying.
Here is screenshot - http://postimg.org/image/ueeufodc9/
U can see original images in the green area.
source code:
sf::Sprite s;
for(....){
s.setPosition(grid[x+i][y+j].bullets[k].x,grid[x+i][y+j].bullets[k].y);
s.setRotation(grid[x+i][y+j].bullets[k].r* PIOVER);
s.setTexture(bullets_tex[grid[x+i][y+j].bullets[k].id]);
(window_argument).draw(s);
}
Thanks for help.
-
I'm not entirely sure what you're trying to achieve. You trying to draw both the rockets and bullets inside of one sprite as they move?
-
s.setTexture(bullets_tex[grid[x+i][y+j].bullets[k].id], true);
use true for reset texture rects
-
thanks it work :)