Hello Guest

Author Topic: Animated tiled sprites?  (Read 3442 times)

Ultroman

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Animated tiled sprites?
« on: March 05, 2016, 05:47:10 pm »
I just bought tk2d, and while the API seems great, I was sad to see that the Tiled Sprite implementation couldn't be animated. Reading up on it on the forums reveals, that trying to enforce animations on it, creates a lot of garbage, and isn't recommended.

I'm making an open elevator/lift, and wanted to use the Tiled Sprite to make long, animated cables running up and down behind the elevator. If I can't use the Tiled Sprite, then I'll have to spawn many of the same Sprite Animators, and do animations on all of them, or use a lot of textures with animated UV-mapping on them, while trying desperately to make them line up and be in sync.

Is there no chance to see an animated Tiled Sprite implementation in the near future? It would be very valuable for things like running water, sandstorms and long moving things like cables :D

Sincerely, Ultroman the Tacoman

EDIT:
Now I just read the documentation on animation, and at the very bottom, a small notes states that you CAN animate a Tiled Sprite. I tried, and as far as my profiler says, it doesn't incur extra allocations. Was this fixed some time ago?
« Last Edit: March 05, 2016, 06:17:38 pm by Ultroman »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Animated tiled sprites?
« Reply #1 on: March 07, 2016, 09:47:15 am »
Quote
Now I just read the documentation on animation, and at the very bottom, a small notes states that you CAN animate a Tiled Sprite. I tried, and as far as my profiler says, it doesn't incur extra allocations. Was this fixed some time ago?

We rewrote the geometry generation part a while back - there shouldn't be allocations if you have exactly the same number of verts / tris. There's always a much easier option to do this using a shader and geometry, but if this works for you and you're not struggling for performance then just keep using the animated tilemap.