Welcome,
Guest
. Please
login
or
register
.
March 23, 2025, 10:17:12 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
DragItem in world space
« previous
next »
Print
Pages: [
1
]
Author
Topic: DragItem in world space (Read 2321 times)
soofaloofa
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 27
DragItem in world space
«
on:
June 04, 2012, 01:27:52 PM »
Hi,
I copied the DragDropItem script for use in my game but now when I drag the item does not follow the mouse correctly. How can I convert the OnDrag event to use world space coordinates instead of screen space?
Thanks!
Logged
soofaloofa
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 27
Re: DragItem in world space
«
Reply #1 on:
June 04, 2012, 02:41:47 PM »
In testing I found that it works correctly if UIRoot is set to Automatic. Setting UIRoot to manual means the delta passed in from OnDrag is not correct. How can I adjust this value so it will work with my UI.
Thanks!
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: DragItem in world space
«
Reply #2 on:
June 04, 2012, 03:04:31 PM »
Just account for UIRoot.manualHeight / Screen.height.
Logged
soofaloofa
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 27
Re: DragItem in world space
«
Reply #3 on:
June 04, 2012, 03:46:44 PM »
Works perfectly. Thank you!
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
DragItem in world space