-SOLVED- Game in Landscape Mode?

I want to make a game in landscape mode, but I can’t seem to figure out how. I made my game width 800 and my height 480. Then, in my build settings, I put that it’s default is “landscapeRight” and it only supports “landscapeRight”. My goal here is to get the simulator to rotate like it does for Tilt Monster. Unfortunately, I don’t know how to do it.

A picture says a thousand words…
http://dl.dropbox.com/u/27644193/Makin'%20Bank.PNG

config.lua
[lua]application =
{
content =
{
width = 800,
height = 480,
scale = “letterbox”,
},
}[/lua]

build.settings

[code]settings =
{
orientation =
{
default = “landscapeRight”,
supported = {“landscapeRight”, “landscapeLeft”},
},

android =
{
versionCode = “1”,
versionName = “1.0”,
},
}[/code] [import]uid: 103624 topic_id: 17688 reply_id: 317688[/import]

Anyone know? This is really bothering me… [import]uid: 103624 topic_id: 17688 reply_id: 67348[/import]

change this line,
[lua]supported = {“landscapeRight”,“landScapeLeft”},[/lua]
also if you are for android my guess due to 480x800 it supports only landscapeRight

more config.lua should be like,
[lua]application =
{
content =
{
width = 480,
height = 800,
scale = “letterbox”,
},
}[/lua]
:slight_smile: [import]uid: 12482 topic_id: 17688 reply_id: 67361[/import]

I tried what you said, but the simulator was still in portrait mode . :confused: [import]uid: 103624 topic_id: 17688 reply_id: 67363[/import]

You have a missing comma in your build.settings between the versionCode and versionName entries. Any syntax error will cause the build.settings not to be used.

Unfortunately there’s no error messages about this anywhere when you compile/run, but I’ve read in other posts that Ansca is aware of this problem. [import]uid: 70847 topic_id: 17688 reply_id: 67364[/import]

I did what you said, and now I have a display problem. Check the first post for an updated picture and code. [import]uid: 103624 topic_id: 17688 reply_id: 67365[/import]

this is how my build.setting looks like

[lua]settings =
{

orientation =
{
default = “landscapeRight”,
supported =
{
“landscapeLeft”, “landscapeRight”
},
},

}[/lua]

and it gives me landscape mode only
are you sure you are working with the right file means sometimes we found problem when in simulator there is different file and we are editing different file

[import]uid: 12482 topic_id: 17688 reply_id: 67366[/import]

Not sure what to make of this, but it looks like there’s a mismatch between the content size you’ve specified (480x800) and the way you create your objects in your code.

All objects’ coordinates must be set within the size given in config.lua, and since your orientation is in landscape you have a canvas that’s 800 pixels wide and 480 pixels high.

For example, if you want a background fill with your settings you would use

local tmpSquare = display.newRect(0,0,800,480);

My images and config are right, but for some reason it thinks that (0, 0) is located towards the middle of the screen. The starting height is correct, but the ending height is not. Neither the starting or ending width is correct. If you don’t know what I mean, click the picture link in the first post. [import]uid: 103624 topic_id: 17688 reply_id: 67502[/import]

Hmmm. It’s difficult to guess what the problem may be…
Could you post some code that produces the output in your test image you linked to above? [import]uid: 70847 topic_id: 17688 reply_id: 67505[/import]

Other than the config and settings above?

game.lua (the scene when the picture is taken)
[lua]module(…, package.seeall)
display.setStatusBar(display.HiddenStatusBar)
local gameGroup = display.newGroup()
require(“physics”)

function new()
setUpPhysics()
createScene()
createPig()
return gameGroup
end

function setUpPhysics()
physics.start()
physics.setGravity(0, 0)
end

function createScene()
local background = display.newImage(“visuals/game_background.png”, 0, 0)
local ground = display.newImage(“visuals/game_ground.png”, 0, 445)
gameGroup:insert(background)
gameGroup:insert(ground)
end

function createPig()
local pig = display.newImage(“visuals/game_pig.png”, 384, 397)
gameGroup:insert(pig)
end[/lua] [import]uid: 103624 topic_id: 17688 reply_id: 67606[/import]

have you moved your gameGroup or set its position anywhere??

otherwise (0,0) is the topLeft corner of your device also as previously ur config.lua has wrong setting and you have changed that have you seen any changes after that have you changed coordinates of your group or objects accordingly
:slight_smile: [import]uid: 12482 topic_id: 17688 reply_id: 67644[/import]

One thing I noticed is that the config.lua you posted now has a syntax error, which can cause weird behavior.
There’s an extra ‘}’ at the end of the file that needs to be removed.
You should be getting an error message in the Terminal window about this though.

From the game.lua code you posted everything looks OK. As long as your background.png is created as a 800x480 image, and that you’re not doing any manipulation to the gameGroup after it has been returned.

If you still get this behavior after correcting the syntax error I mentioned above, I would like to stress is that you double-check that you’re using the right config.lua.
I get the exact same output as your screenshot when the settings in config.lua are incorrectly set to width=800 and height=480, which indicates to me that your app still isn’t using the correct config.lua.
[import]uid: 70847 topic_id: 17688 reply_id: 67670[/import]

The extra } at the top was a typo, not something that is actually in my code. And I tested if my config was being used with a print(), and it said that it was being used. I really don’t know what the problem could be… [import]uid: 103624 topic_id: 17688 reply_id: 67729[/import]

I was able to fix it!

It’s because my config had width = 800 and height = 480, when those should have been reversed.

Thank you everyone who helped! [import]uid: 103624 topic_id: 17688 reply_id: 67732[/import]

Great!

However that was exactly what @hgvyas123 said in post #2 :slight_smile: [import]uid: 70847 topic_id: 17688 reply_id: 67733[/import]

lol i was thinking that was changed and not seen that again but important thing it has been solved now.
:slight_smile: [import]uid: 12482 topic_id: 17688 reply_id: 67854[/import]