Hello Guest

Author Topic: Use SetTextureOffset in 2dToolkit  (Read 3868 times)

tzamora

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Use SetTextureOffset in 2dToolkit
« on: March 25, 2013, 03:59:25 pm »
Is there a way to use Material.renderer.SetTextureOffset to scroll 2dtoolkit sprites?

If not is there a similar way in 2dtoolkit to achieve the same functionality?

Thanks a lot  ;D

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Use SetTextureOffset in 2dToolkit
« Reply #1 on: March 25, 2013, 07:32:24 pm »
You can't scroll like that, as the texture will be atlased. If its just one texture you need to do this on, then you can create a plane and apply it directly. This will break batching but there isn't any real super efficient way around this without doing so.

One more trick that could work is to use the Clipped Sprite to simulate scrolling - i.e. offset position + offset clip region over time. You should repeat the texture 2x if you want to do this to avoid having to create seams and add poly count.