Author Topic: Change Depth by Code  (Read 4389 times)

trollg

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Change Depth by Code
« on: June 28, 2013, 01:41:47 AM »
Hi, I m a newbie with ngui, and I am using the free edition to check if it fits my needs for a project I want to make, and if so, to buy it.
So far, I have made a drag & drop scenario using my custom scripts and widget buttons with the sci-fi atlas, and it works really cool.  ;D
Its important for the dragged object, when dragged to be in front of everything else on screen. Maybe its a lame question but how do I do that? Can I change the depth value by code? The dragged objects are buttons consisting by a label and background. Changing the z value didn't work. Do I have to use 3d camera? Please give me the most optimized solution.

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Change Depth by Code
« Reply #1 on: June 28, 2013, 04:11:01 PM »
UIWidget.depth if on the same panel, transform.position.z if not.

Free version of NGUI doesn't come with support. It's meant as a preview. It's also over a year old.