Hello Guest

Author Topic: Offsetting the material's texture for parallax scrolling effects.  (Read 7757 times)

Bigcheese

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 19
    • View Profile
I know it's not possible to use the regular

                 "renderer.material.SetTextureOffset("_MainTex", new Vector2(-Time.time * scrollingSpeed, 0));"

To offset a texture of a sprite. but is there another way to do it with the 2D toolkit? I'm using the tk2dCamera with my collections.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Offsetting the material's texture for parallax scrolling effects.
« Reply #1 on: December 13, 2012, 01:24:11 am »
If all you need is parallax, have you looked at the parallax sample?
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,87.0.html

You can't scroll texture offsets like that, as the textures are in an atlas. There are ways around it but none of them are "pretty". The option above should work if all you need is parallax though.

arvz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Offsetting the material's texture for parallax scrolling effects.
« Reply #2 on: April 02, 2014, 01:45:54 pm »
Hey Unikron,

The above parallax sample sample thread seems to have disappeared since you posted it. Is there an updated sample?

Thanks

edit: nevermind, found it! http://2dtoolkit.com/forum/index.php/topic,87.0.html
« Last Edit: April 02, 2014, 01:49:03 pm by arvz »