Support => NGUI 3 Support => Topic started by: Amitloaf on August 06, 2012, 10:27:54 AM
Title: Non-Automatic UIRoot affects mouse position on drag
Post by: Amitloaf on August 06, 2012, 10:27:54 AM
When dragging, the delta given to the OnDrag Method is the same as the mouse delta got from Input.mousePosition. On automatic height UIRoot it works great. When turned off, the mouse and the object trying to follow it with Drag are progressing differently, depending on resolution. Is there a method for converting the mouse position to the dragged object position on Manual Height UIRoot, or something similar?
Title: Re: Non-Automatic UIRoot affects mouse position on drag
Post by: ArenMook on August 06, 2012, 01:46:28 PM
Multiply it by UIRoot.screenSize / Screen.height.
Title: Re: Non-Automatic UIRoot affects mouse position on drag
Post by: nospam94 on January 11, 2013, 12:05:12 PM
HI, If we have multiple camera with UICamera script and different UIRoot, how to access the correct UIRoot for setting correct ondrag (delta) for example.
if it is UICamera that send the onDrag event that we receive for example in DragDropItem, would'nt be better to calculate correcte mouse delta in UICamera ?
Title: Re: Non-Automatic UIRoot affects mouse position on drag
Post by: ArenMook on January 11, 2013, 01:15:36 PM
NGUITools.FindInParents<UIRoot>(gameObject)
Title: Re: Non-Automatic UIRoot affects mouse position on drag
Post by: enzi on May 27, 2013, 06:00:24 PM
Just stumbled upon this.
UIRoot.screenSize doesn't exist anymore. What can I use instead?
Thanks
edit: Got it
int manualHeight = NGUITools.FindInParents<UIRoot>(gameObject).manualHeight;