Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: frog on August 22, 2012, 04:01:08 AM

Title: how to anchor buttons to corners of screen
Post by: frog on August 22, 2012, 04:01:08 AM
how do you anchor buttons to corners of screen?
Title: Re: how to anchor buttons to corners of screen
Post by: Nicki on August 22, 2012, 05:17:37 AM
Look into UIAnchor.cs. Set the widget-pivot to the opposite of the UIAnchor-pivot and there you go.
Title: Re: how to anchor buttons to corners of screen
Post by: nah0y on August 22, 2012, 05:19:58 AM
I think what you want is described here :
http://www.tasharen.com/?page_id=418
Title: Re: how to anchor buttons to corners of screen
Post by: PhilipC on August 22, 2012, 10:08:13 AM
Correct UIAnchor is what you need. It has options like, TopLeft, TopRight, BottomLeft, BottomRight, which would be the corners.
Title: Re: how to anchor buttons to corners of screen
Post by: bitomule on October 03, 2012, 01:40:57 PM
Hi!

I'm having a similar problem, but I'm already using UIAnchor. My problem is, what happens if aspect ratio is different. Let me explain myself:

- I place a button using UIAnchor to the top left, anchor set to top left.
- It works perfect inside editor, I can change the window size and it's at the right position.
- But, on iPhone5 button is not top aligned, it just goes out of screen.

How can I make it work?

Thanks!
Title: Re: how to anchor buttons to corners of screen
Post by: ArenMook on October 03, 2012, 07:58:54 PM
Why would it? Top-left is top-left, regardless of the aspect ratio. Try building the first example for your device.
Title: Re: how to anchor buttons to corners of screen
Post by: yuewah on October 04, 2012, 08:33:36 AM
@bitomule, what is NGUI and Unity version ?