简体   繁体   中英

Corona SDK distribution and size of objects

How to indicate the sizes of objects and their coordinates when developing a mobile game. For buttons, I tried to indicate a percentage of the screen size (local scrPercentW = display.actualContentWidth / 100) or division of a constant display.contentCenterX (display.contentCenterY). But in the simulator on some devices it's right, but at some intervals and sizes it's wrong.

For example, I have four buttons on the menu that I need to arrange at the same distance from each other and from the edges of the screen. How should I do it?

I see that you resolved the problem of display.contentWidth, while for the size of a text you just need this:

local someText = display.newText( "here goes your text", 20, 80 )
someText.size = 30

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM