Author Topic: How to tween to a relative position?  (Read 4585 times)

prz22

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
How to tween to a relative position?
« 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!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to tween to a relative position?
« Reply #1 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.

prz22

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: How to tween to a relative position?
« Reply #2 on: February 05, 2014, 03:44:38 AM »
Thank you!
Can you give me a simple example of how can i accomplish that?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to tween to a relative position?
« Reply #3 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.