Author Topic: Basic Tweening with a script question  (Read 1819 times)

Diplogy

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
Basic Tweening with a script question
« on: June 18, 2014, 04:48:25 PM »
Hi Guys
Sorry to bother with what must be a really simple problem I'm having.
Basically I don't know how to tween a Menu/Panel in and out of the screen. I'm using TweenTransform with two game objects, one off camera and one in the centre of the camera and I have the below call in a GameManager script:
  1. if (IsPaused){
  2.                         NGUITools.SetActive(pauseMenu,true);
  3. }
This pulls the menu out from off screen, but it only slides out once. I want to be able to either disable it once it's finished tweening back so that it moves back into the screen again once the game is paused or be able to call something like
  1. NGUITools.TweenTransform(pauseMenu,PlayForward)
  2.  
or something like that but I can't figure out how to do it.
Sorry for asking the obvious, it's just not clear to me how to do this with a script call.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Basic Tweening with a script question
« Reply #1 on: June 18, 2014, 06:05:47 PM »
Use the TweenTransform.Begin function. It's the same with all tweens -- TweenXXX.Begin(targetGameObject, duration, targetValue);

Diplogy

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Basic Tweening with a script question
« Reply #2 on: June 22, 2014, 12:28:30 PM »
Yes!! This is exactly what I was looking for!
Many thanks ArenMook!  :)