Author Topic: UICursor Depth?  (Read 7602 times)

stevej

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 117
    • View Profile
UICursor Depth?
« on: January 20, 2015, 08:07:28 PM »
How can I set UICursor to a particular panel? I currently have a panel sitting on top of everything else which I use to show tooltips. Trying to have the cursor on this panel too as it currently goes behind some UI elements.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICursor Depth?
« Reply #1 on: January 20, 2015, 10:30:40 PM »
Cursor goes behind elements? What cursor? If you're drawing a sprite for your cursor, then simply adjust the depth of the panel it's using.

stevej

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: UICursor Depth?
« Reply #2 on: January 21, 2015, 10:19:08 PM »
As in, if I draw a cursor like so:

  1. UICursor.Set(itemDragAtlas, spriteName));
  2.  

It goes behind elements in some of my scrollviews which are no their own panels.

As I'm only referencing an atlas (and a string for the sprite name), I wasn't sure how to mess with the cursor's depth?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICursor Depth?
« Reply #3 on: January 22, 2015, 12:10:23 PM »
UICursor is an example script used by the NGUI's character inventory scene. It's simply a sprite that belongs to a panel. If you want this panel to be on top, change its depth to one that's higher than others.

stevej

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: UICursor Depth?
« Reply #4 on: January 24, 2015, 01:30:12 AM »
Ahh... all good - I've misunderstood what UICursor is all about then. Didn't realise it was just an example.

I've done my own little version of it now that works on the right Panel etc. All good! :)