Hi,
If I create a layout with 3 nodes in it and I set the layout Type to be VERTICAL then is there a way to set the Spacing Y to be 20% of the screen size (cc.winSize.height) or will I have to set this manually by code in a script?
I don’t want a fixed pixel size of spacing. I would imagine setting a percentage of the screen would be better so the content is spaced out properly between small to big size screens. If it is a fixed spacing size then I think it would not be spaced out well on a big device and spaced out too much on a small device.
Same goes for scaling. If I have 3 buttons placed vertically in a layout (or without a layout) I would like to scale my nodes according to the screen size. So small screens would have a small/normal size button and users of big screen devices would see a big button.
I am able to scale these in a script like this
onLoad: function () {
var nodeScale = (cc.winSize.height * this.nodeHeightPercent) / this.node.height;
this.node.setScale(nodeScale);
},
but I’m wondering if there is an easier way to do so in Creator?
Thanks!