Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Genhain on October 30, 2014, 10:45:47 PM

Title: [SOLVED]UICenterOnChild with offset?
Post by: Genhain on October 30, 2014, 10:45:47 PM
I was just going to make a child class and override any virtual functions to find this is a rather black boxed class. I cant immediately think of any way of having the scroll center On a child except with an offset in either x or y, while keeping the clipping regions exactly as is and where you want them, without modifying the existing class.
Title: Re: UICenterOnChild with offset?
Post by: ArenMook on November 01, 2014, 05:01:13 AM
UICenterOnChild centers on transforms directly underneath. You can easily add an offset like so:

UICenterOnChild
- Child 1
-- Offset
--- Content
- Child 2
-- Offset
--- Content
- Child 3
-- Offset
--- Content

Of course alternatively you can just modify the UICenterOnChild, or create a custom version of it that includes an offset if you like.
Title: Re: UICenterOnChild with offset?
Post by: Genhain on November 02, 2014, 09:43:51 PM
I imagined there would be a way to achieve this through how you parented certain elements...and now that you say it. It makes perfect and simple sense, i must have been tired. Cheers Aren