Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: csdn_ss on June 14, 2014, 10:37:03 AM
-
How to divide the Game View into equal parts
Just like the App named "Don't step on the tip"
I want in Camera , I can see 16 Buttons(Four rows and four columns)divide the view in equal parts
But I don't know how to set position
there are too large space
I use Screen.width/4 and Screen.higtht/4 ,but in UIRoot Camera, transform can't be set value like this
The next picture is what I want in Play Game View ,it's takes all the screen
-
You shouldn't be trying to set transform.position, but transform.localPosition should be fine if you're using a pixel-perfect UIRoot.
The best way to achieve what you're trying to do is to use anchors. The anchor system has both absolute pixel offsets as well as relative, percent-based values. I suggest examining its documentation and playing around with it.
-
Could you please tell me how to use anchors system by using percent-based values detail
Is it right where I find anchor system in my picture below.
Better give me a picture ,Thank you very much
-
How to set UIRoot pixel-perfect
-
The last question is each button(16 buttons) on the second picture,seem one by one , close to each other.
but they are not,I just Ctrl + D,and put them like this , I want each button take 25%width,25%height(view in Camera ) ,and close to each other.They can expand or change their size when the camera view expand(Auto fit) .
-
Check the documentation for UIRect. It explains how to use percent-based anchoring.
http://www.tasharen.com/forum/index.php?topic=7013.0