Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: jacksmash on November 24, 2014, 07:59:26 PM

Title: Move UITexture around screen with mouse
Post by: jacksmash on November 24, 2014, 07:59:26 PM
I have a UITexture using the DownloadTexture script to get the image. This works fine, but I'd like to allow the user to resize the texture with the mouse and also drag it around the screen. What is the best approach to this?
Title: Re: Move UITexture around screen with mouse
Post by: ArenMook on November 25, 2014, 01:38:15 AM
ALT+SHIFT+C to add a collider and add UIDragObject to it.

To resize, UIDragResize. Check the chat window example, it's a resizable window.
Title: Re: Move UITexture around screen with mouse
Post by: jacksmash on December 01, 2014, 07:36:31 PM
Thanks! Dragging works great! I'm missing the resize script so I must need to update my NGUI package :)
Title: Re: Move UITexture around screen with mouse
Post by: jacksmash on December 04, 2014, 07:06:54 PM
Is there a way to have the drag script maintain the aspect ratio of the widget being resized?
Title: Re: Move UITexture around screen with mouse
Post by: ArenMook on December 05, 2014, 01:00:57 AM
Widgets have an aspect ratio field. You will need to set it to something other than "free".
Title: Re: Move UITexture around screen with mouse
Post by: jacksmash on December 08, 2014, 07:48:32 PM
Apologies. Missed that. All good now.