android - corona simulator doesn't show full image -


i'm creating simple game using corona.

first thing i'm trying load background image; got that, corona simulator show small part of image @ top left side , rest of image stay black if used scaling mode , i'm sure image size.

then added 3 parameter display.newimage method got better situation still have black bar on left.

my config.lua

application = { content = {     fps = 60,     width = 320,     height = 480,     scale = "zoomeven",    -- xalign = "center",     --yalign = "center",     imagesuffix = {         ["@2x"] = 2;     }, }, } 

and main.lua

local background = display.newimage("images/clouds.png"); 

first result on devices enter image description here

then made got better result make small edit main.lua

local background = display.newimage("images/clouds.png",230,150, true); 

and second result enter image description here

you must modify anchor property, property allows control alignment of object along x or y direction. default, new objects have anchor set 0.5 corresponds center alignment. setting 0 meaning left edge of object.

local background = display.newimage("images/clouds.png"); background.anchorx = 0 background.anchory = 0 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -