Hello,
my problem is, that if someone uploads in image, I have to scale it to fit screen.
So I wrote this script, but this will not work with other image-sizes…
any hint what to do better?
function createImage( path, pX, pY ) local image = display.newImage( path, true ) if ( image.width \> image.height ) then image.rotation = 90 end if ( image.width \> gX ) or ( image.height \> gY ) then image.xScale = ( 0.5 \* image.contentWidth )/ image.contentWidth image.yScale = image.xScale end image.x = pX image.y = pY return image end