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

Author Topic: Looking for the proper way to tile an animated sprite  (Read 1207 times)

0 Members and 1 Guest are viewing this topic.

m33pn8r

  • Newbie
  • *
  • Posts: 5
    • View Profile
Looking for the proper way to tile an animated sprite
« 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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Looking for the proper way to tile an animated sprite
« Reply #1 on: April 10, 2014, 05:34:50 pm »
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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything