SFML community forums
Help => Graphics => Topic started by: m33pn8r on April 10, 2014, 05:08:04 pm
-
Pretty much what the title says, just looking for the proper way to tile an animated sprite.
I have a 4 frame image I'm looking to tile as a background, stored as a 16x64 png.
As is, I can animate a single instance of it just fine, using sprite.setTextureRect(). However, I'm not sure of the proper way to repeatedly tile the sprite across the background.
Also, I'm using JSFML if it makes a difference.
Any suggestions?
-
Well it depends what you're essentially doing, but to "tile" something you simply draw it at multiple locations.
If you need to draw it a lot, then you could use a vertex array and set the vertices properly.