Author Topic: UICursor  (Read 4784 times)

matix

  • Guest
UICursor
« on: May 10, 2012, 07:24:16 AM »
Hey, how i can do the UICursor on Top of the Unitys OnGUI(); ?
and how too Rotate the Cursor like in the AngryBots demo?

http://www.friendshangout.com/games/899.php

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICursor
« Reply #1 on: May 10, 2012, 02:24:58 PM »
You can't put NGUI on top of Unity's GUI. Use NGUI for the cursor instead.

Rotating the cursor is a simple matter of rotating the transform of the widget.

zxhfrombnu

  • Guest
Re: UICursor
« Reply #2 on: August 16, 2012, 03:20:09 AM »
hi, there. I want to change cursor in the game. So I use GNUI UICursor. But it does not work. Can you help me? I need the process  in detail and more clearly. Thanks a lot.  :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICursor
« Reply #3 on: August 16, 2012, 10:14:57 AM »
GNUI? Is that supposed to be NGUI or OnGUI?

NGUI's UICursor is an example script. As I recall it's used only in the inventory example. Changing the sprite on it is done by calling UISprite's Set(atlas, spriteName) function.

zxhfrombnu

  • Guest
Re: UICursor
« Reply #4 on: August 16, 2012, 08:17:29 PM »
Yeah, I mean NGUI. I want to use UICursor's Set(atlas, spriteName) function to make my own cursor and change its shape in the game. I have made it by OnGUI but the result is bad. It is slow. So I want a better solution. I need your advice.
In the inventory example (Did you mean Assets\NGUI\Examples? ), I have not seen the use of UICursor.  In fact, I do not know how to used it correctly.
Besides, "Changing the sprite on it is done by calling UISprite's Set(atlas, spriteName) function." what mean it? Is it a gameobject or somethings else. Thanks very much. :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICursor
« Reply #5 on: August 17, 2012, 09:24:07 AM »
UIItemSlot class uses it. Like I said, inventory example. Look for UIItemSlot.UpdateCursor function. The cursor done this way is always going to lag behind the mouse by a frame or two. If you want something immediate, you have to change the actual mouse cursor.

zxhfrombnu

  • Guest
Re: UICursor
« Reply #6 on: September 07, 2012, 05:10:19 AM »
Thanks, I see the example and understand better. ;) Sorry for reply so late.