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

Author Topic: Have Sprite IntRects point to a parent  (Read 1834 times)

0 Members and 1 Guest are viewing this topic.

Xhalth

  • Newbie
  • *
  • Posts: 1
    • View Profile
Have Sprite IntRects point to a parent
« on: March 04, 2017, 09:24:37 am »
Hello, new user here.

I am working on a tilemap with animated tiles, and thought that it might be efficient to have animated tile sprites keep a pointer to a parent TextureRect (or IntRect). This way the child IntRects of tiles with the same ID as the parent will update more efficiently, and iterating through each animating tile wouldn't be necessary. Having a parent IntRect would mean that the sprites would still be position-independent, contrary to keeping a pointer to an entire parent Sprite. I'm currently thinking about animated tiles such as water that usually need to be playing at the same rate. Any ideas on how to go about doing something like this? Is this just a silly idea?