The screen has scaled itself in a weird way. Please help :)

Hi.

I’m trying to rewrite one of my Java games in Lua using Corona

just started on this Corona thing yesterday, and i’m already lost.

i wrote 1 line of code, and i’m doing something wrong…

Please take a look:

GmgmDpP.png

BLqImTH.png

The display is set to be 1920*1080, and the image is 1920*1080.

I tried setting the x position of the image, and i have now come to the conclusion, that it has somehow scaled the screen down to the area that the image is in.

I tried starting a new project, but it does the same.

Even if i export the app to my HTC ONE, it does the same thing.

Please help! :slight_smile:

Please share the code :slight_smile:

Its literally that one line.

If you are interested in the config.lua, then here you go :slight_smile:

application = { content = { width = 1920, height = 1080, scale = "letterBox", fps = 30, --[[imageSuffix = { ["@2x"] = 2, } --]] }, --[[-- Push notifications notification = { iphone = { types = { "badge", "sound", "alert", "newsstand" } } } --]] }

Heres the build.settings:

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft"} }, iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } --]] } }, --[[-- Android permissions androidPermissions = { "android.permission.INTERNET", },]]-- }

Sorry, but I can’t see even that one line :frowning:

local background = display.newImage("test.png")

Can you see the image where i illustrated the problem? :slight_smile:

Found problem, image is on default positioned on 0, 0. But your 0, 0 point is in reality moved to 1164,0 on screen.

Fault lays in this that you definied content as 1280x1080 (even on tablets, bigger screen doesn’t mean more pixels! it means bigger pixels. Iphone5 has 1136x640, galaxy SII has 1280×720 and bigger iPad 2 has 1024 na 768), so that’s why it looks small. Grab this file https://www.dropbox.com/s/yzs8bfc0drs4rwo/config.lua and past it’s content into your config.lua. Tested and it resolved problem :slight_smile:

I’m sorrry - but i can’t seem to find where in the code this is shown?

Edit: got it now, thanks! :slight_smile:

You don’t have it in your code. I get this info, because I checked some display properties and it showed me that there is such offset. If you are interested I called display.screenOriginX and Y :slight_smile:

Remember that on devices (and you will see this on simulator) point (0, 0) isn’t always top left pixel! In reality what you think is 0, 0 can be -50, -30 for example. display.screenOrigin tells you where is real 0, 0 (as seen on screen) from programatic 0, 0 (so it is negative value)

Hi @sebfoghk,

In your “config.lua” file, the “width” setting is always the SHORT side, even if you’re designing a landscape-oriented app. Landscape orientation itself is configured in “build.settings”.

I recommend that you view some tutorials and videos on this subject, especially:

  1. Content Area (video)

  2. Project Configuration

  3. Project Build Settings

All of these are located in Corona University here:

http://www.coronalabs.com/resources/tutorials/corona-basics/

Hope this helps,

Brent Sorrentino

Please share the code :slight_smile:

Its literally that one line.

If you are interested in the config.lua, then here you go :slight_smile:

application = { content = { width = 1920, height = 1080, scale = "letterBox", fps = 30, --[[imageSuffix = { ["@2x"] = 2, } --]] }, --[[-- Push notifications notification = { iphone = { types = { "badge", "sound", "alert", "newsstand" } } } --]] }

Heres the build.settings:

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft"} }, iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } --]] } }, --[[-- Android permissions androidPermissions = { "android.permission.INTERNET", },]]-- }

Sorry, but I can’t see even that one line :frowning:

local background = display.newImage("test.png")

Can you see the image where i illustrated the problem? :slight_smile:

Found problem, image is on default positioned on 0, 0. But your 0, 0 point is in reality moved to 1164,0 on screen.

Fault lays in this that you definied content as 1280x1080 (even on tablets, bigger screen doesn’t mean more pixels! it means bigger pixels. Iphone5 has 1136x640, galaxy SII has 1280×720 and bigger iPad 2 has 1024 na 768), so that’s why it looks small. Grab this file https://www.dropbox.com/s/yzs8bfc0drs4rwo/config.lua and past it’s content into your config.lua. Tested and it resolved problem :slight_smile:

I’m sorrry - but i can’t seem to find where in the code this is shown?

Edit: got it now, thanks! :slight_smile:

You don’t have it in your code. I get this info, because I checked some display properties and it showed me that there is such offset. If you are interested I called display.screenOriginX and Y :slight_smile:

Remember that on devices (and you will see this on simulator) point (0, 0) isn’t always top left pixel! In reality what you think is 0, 0 can be -50, -30 for example. display.screenOrigin tells you where is real 0, 0 (as seen on screen) from programatic 0, 0 (so it is negative value)

Hi @sebfoghk,

In your “config.lua” file, the “width” setting is always the SHORT side, even if you’re designing a landscape-oriented app. Landscape orientation itself is configured in “build.settings”.

I recommend that you view some tutorials and videos on this subject, especially:

  1. Content Area (video)

  2. Project Configuration

  3. Project Build Settings

All of these are located in Corona University here:

http://www.coronalabs.com/resources/tutorials/corona-basics/

Hope this helps,

Brent Sorrentino