Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17078

Automatic layout positioning of children

$
0
0

@ropo wrote:

I have 2 items as children in a layout. Is it possible to automaticaly align them in the center so they will always be positioned like that (relative). Right now I can only specify it in pixels which is problematic if the screen resolution changes.

I attached the image of how I want the items to be alligned automaticaly. Right now I would have to specify the padding and spacing in pixels. I would want it to be able to compute that automaticaly.

Is that possible yet or must I program it in C++ myself?

I would also like to know if it's possible to automatically expand layout sizes: for example if I have 3 layouts inside a parent layout: is it possible to set a "weight" (eg percent size) of each child so that they will fill the parent (so for example one layout takes 25% of the space, one takes 50% and the third takes 25% of space? Ascii: [ABBC], where A,B,C are the 3 layouts, where B has twice the width of A and C.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 17078

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>