Background Image Issues

I am a new user of Corona and trying to learn code. I have just started to develop a game and I want it in the Landscape view always. I have gotten my opening screen up and in the landscape view but my image is slightly too big and I want to scale it down. My files look like this below.

Also the build.settings file is that a file you create in text editor also. I wanted to look in some of the build.settings files of the example apps they have posted on the site but I can’t open them. What kind of file is it and how do you create one?

Thanks a million for your help!

Michelle

config.lua (file 1)

application =
(
content =
(
width = 320,
height = 480,
scale = “letterbox”
)
)

titlescreen.lua (file 2)
local background = display.newImage (“title.jpg”, 0, 0, true)
background.x = display.contentWidth / 2
background.x = display.contentHeight / 2
localGroup:insert(background)

return localGroup
end [import]uid: 72372 topic_id: 12018 reply_id: 312018[/import]

Heya,

You can open build.settings in the same text editor that you use for Lua, just drag and drop. (If you’re looking for a text editor, Eddie is basic and clean.)

For your background image; I’d resize it manually myself in Photoshop (or the like) - but you can also use xScale and yScale if you really don’t want to.

Hope that helps!

Peach :slight_smile: [import]uid: 52491 topic_id: 12018 reply_id: 43874[/import]

Peach,

Thank you so much for the reply. In regards to the build.settings file, all of them are grayed out and I can’t select them. I have tried several times. This is even on the sample examples on the website. I am currently using TextWrangler.

In regards to photoshop, I have not used that but I do have it. I thought you could only save files as a photoshop extention. Can you save as a .png or .jpg in that software. Thanks a million.

Michelle [import]uid: 72372 topic_id: 12018 reply_id: 43876[/import]

Peach,

I got the background image fixed and centered the way I wanted it. I have one other question and I have seen several ways to do it but it does not seem to want to work for me. I want a red block to drop when my titlescreen opens. I tried to use the simple code from the program in 8 minutes and it doesn’t seem to work. This is what I have and if it works I should be able to throw the block around also. Can you see what’s wrong in my code?
[lua]module(…, package.seeall)

function new()
local localGroup = display.newGroup()



local physics = require(“physics”)
physics.start()
physics.setGravity(0, 4.9)

system.activate( “multitouch” )

– physics.setDrawmode(“hybrid”)

local background = display.newImage (“title2.png”)
background.x = display.contentWidth / 2
background.y = display.contentHeight / 2
localGroup:insert(background)
–> This sets the background

local redblock = display.newImage(“redblock.png”)
redblock.x = display.contentWidth/2
physics.addBody( redblock, (bounce = 0.4, friction = .2) )

– Define our touch event listerner.
function doImpulse(event)
redblock:applyLinearImpulse( 0, -0.2, event.x, event.y )

end

–Add the listener to our redblock
redblock:addEventListener(“touch”, doImpulse)[/lua]

*Edited by Peach Pellen: Please put code you post in Lua tags. < lua > and < / lua > without the spaces. Much easier to read :wink:
[import]uid: 72372 topic_id: 12018 reply_id: 43964[/import]

First up, build.settings - download Eddie. http://www.macupdate.com/app/mac/19658/eddie/

I think these should open in any editor but I don’t know for sure; that’s not my area of expertise :wink: But I know Eddie opens them as I use it myself. (It’s free, nothing fancy, just a basic editor.)

For Photoshop, yes, you can save as a bunch of image formats including GIF, JPG and PNG. Hit CMD+SHIFT+S to do a “Save As”, or choose it in the menu manually.

For the block - is this just a visual effect you’re trying to do? If so, do you know how to do a transition? It would be far simpler :slight_smile: [import]uid: 52491 topic_id: 12018 reply_id: 44008[/import]

Got it fixed!!! [import]uid: 72372 topic_id: 12018 reply_id: 44032[/import]

Well done :slight_smile: [import]uid: 52491 topic_id: 12018 reply_id: 44179[/import]

Peach,

How do I post my code on here with Lua Tags. I have been asked to do that but I’m just copying from my file and pasting it now. I assume they want it with the color coding when they say with Lua Tags.

Michelle [import]uid: 72372 topic_id: 12018 reply_id: 44204[/import]

Caleb explained this really well in your other thread - just put < lua > before your code and < / lua > after it. (without the spaces) [import]uid: 52491 topic_id: 12018 reply_id: 44378[/import]