Author Topic: Moving a button  (Read 3624 times)

judy3t

  • Guest
Moving a button
« on: April 15, 2012, 01:50:49 PM »
I have a script that sets the transform for this from a button script with the intent of moving the button to a different place on the panel.  It does render it behind the panel briefly but clearly is the wrong approach.  What is the magic for re-positioning a widget from a script during run time?  I don't seem to be finding it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Moving a button
« Reply #1 on: April 15, 2012, 03:15:42 PM »
Have a look at the drag & drop example. It moves the widgets from one panel to another when the dragging begins or gets cancelled.

judy3t

  • Guest
Re: Moving a button
« Reply #2 on: April 15, 2012, 03:26:33 PM »
I figured it out.  I needed localPosition instead of position and I needed to remove the UIButton Offset script as that was what kept sending the button back to its original position.  Hopefully this will help the next person still at the front end of the learning curve :-)