Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: prz22 on February 02, 2014, 02:25:36 AM

Title: How to tween to a relative position?
Post by: prz22 on February 02, 2014, 02:25:36 AM
Hi!

I'm having trouble with a menu. In this case there's is a button that if you touch it triggers the tween of a sprite containing all the options, but i want it to tween just a 10% of the screen width, so i can run it in various screen sizes.
Can someone please help me?!

Thanks in advance!
Title: Re: How to tween to a relative position?
Post by: ArenMook on February 04, 2014, 01:54:19 AM
You'd have to create a custom tween script. Look at TweenPosition, make a copy of it, and have it use Screen size in some fashion.
Title: Re: How to tween to a relative position?
Post by: prz22 on February 05, 2014, 03:44:38 AM
Thank you!
Can you give me a simple example of how can i accomplish that?
Title: Re: How to tween to a relative position?
Post by: ArenMook on February 05, 2014, 02:58:24 PM
Just make a copy of TweenPosition and modify its "value" property. You may also want to change the "from" and "to". It's a really small script.