Problems qith Background size

Hi everybody!

This is my first aprox to Corona SDK.

Probably for my inexperience, I have problem with te “device” size (1024x600) and my background image size (1024x768)

I create a new project with my specifications:

  • Custom screen size: W:1024 H: 600 (samsung tab size aporx)

  • Orientation: Sideways

My config file is like this:

content = {

        width = 1024,

        height = 600, 

        scale = “letterBox”,

        fps = 30}

when I open my main.lua and resize my image to this resolution corona SDK display dont show me my size choice

    background = display.newImageRect( “atomicbomb.jpg”, display.contentHeight , display.contentWidth )

See the attach File for see the image

Whats wrong? I think that is a simple thing…

Thanks in Advance

There are two things:

  1. You config.lua should always state the width as the narrow size and the height as the long edge.  So flip the two numbers.  We will flip the numbers internally for landscape apps.

  2. display.newImageRect() by default draws it’s object where the center of the image is at 0, 0.  You have to manually position the image as such:

background.x = display.contentCenterX

background.y = display.contentCenterY

Rob

Thanks Rob,
I applyed the changes (flip the sizes and add the image position) and the problem persist.
Is this normal?
How can I cover all the space in the device with my image/background?

Problem solved!!!

I changed the width and height  when I created the image…

Sorry and thanks!!

There are two things:

  1. You config.lua should always state the width as the narrow size and the height as the long edge.  So flip the two numbers.  We will flip the numbers internally for landscape apps.

  2. display.newImageRect() by default draws it’s object where the center of the image is at 0, 0.  You have to manually position the image as such:

background.x = display.contentCenterX

background.y = display.contentCenterY

Rob

Thanks Rob,
I applyed the changes (flip the sizes and add the image position) and the problem persist.
Is this normal?
How can I cover all the space in the device with my image/background?

Problem solved!!!

I changed the width and height  when I created the image…

Sorry and thanks!!