Any easy way to scale widget and it's children?

jsding

06-08-2013 11:05:38

Hi,

It seems that we must iterate all children and invoke setCoord to do simple scale? Any other simple way I am missing?

Thanks for your help.

Altren

06-08-2013 11:56:21

setCoord won't scale skin parts and fonts.
The only way to properly scale everything is to render GUI into texture and then put that texture on screen.
Also you should try Stretch align, it doesn't proportionally scale widgets, but resizes them to keep left/right/top/bottom margins relative to parent.

jsding

06-08-2013 14:31:51

Hi, Altren,

Thanks for your reply. If add scalex, scaley, rotate, skewx, skewy properties to widget like Cocos2D CCNode, MyGUI will be much more powerful.
Then we can build a completed 2d engine on MyGUI with ease.

Is that possible?

Thanks.

setCoord won't scale skin parts and fonts.
The only way to properly scale everything is to render GUI into texture and then put that texture on screen.
Also you should try Stretch align, it doesn't proportionally scale widgets, but resizes them to keep left/right/top/bottom margins relative to parent.