lua - Spawn multiple images in grid evenly -


i have 40 objects placed in 5x8 grid style. object's image 50x50. code use spawning following:

local spawnimage=function(x,y)     circle[bcircle] = display.newimage( "dot1.png" )     circle[bcircle].x =-5+x*55     circle[bcircle].y = 60+y*55     scenegroup:insert(circle[bcircle])     circle[bcircle].value = bcircle      circle[bcircle].tag=false     numcircle[bcircle]= display.newtext(  circle[bcircle].value, spx+x*55, spy+y*55, "helsinki", 16 )     circle[bcircle]:addeventlistener( "touch", touchi )     bcircle = bcircle + 1 end      y=1,8        x=1,5          spawnimage(x,y)        end      end 

the thing cant place them evenly in different devices(simulator)

ipad ipad screenshot

iphone 6 iphone 6

iphone 5 enter image description here

any help? how can place objects evenly in different devices? ideas? help?

thanks!

you don't take display resolution consideration different devices. you're using fixed offsets , sizes different results.

corona can handle scaling if define content properties project.

https://docs.coronalabs.com/daily/guide/basics/configsettings/index.html


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -