2D Toolkit Forum

2D Toolkit => Support => Topic started by: Bigcheese on December 12, 2012, 05:01:28 pm

Title: Offsetting the material's texture for parallax scrolling effects.
Post by: Bigcheese on December 12, 2012, 05:01:28 pm
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.
Title: Re: Offsetting the material's texture for parallax scrolling effects.
Post by: unikronsoftware 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.
Title: Re: Offsetting the material's texture for parallax scrolling effects.
Post by: arvz 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