Keep landscape orientation in Simulator

I need to make game in landscape mode, but its very difficult when corona simulator screen keeps popping straight after restarting
how can i keep specific orientation for simulator(and game obviously)?

something like that in config.lua doesnt work

application =   
{  
 orientation =   
 {   
 width = 320,  
 height = 480,   
 default = "landscapeLeft"  
 }  
}  

thanks in advice [import]uid: 16142 topic_id: 11423 reply_id: 311423[/import]

Make it not inside config.lua but rather in build.settings

Here is my working build.settings file

[lua]settings =
{
orientation =
{
default = “landscapeLeft”,
supported =
{
“landscapeLeft”, “landscapeRight”,
},
},
iphone = {
plist = {
UIAppsFonts =
{
“Impact.ttf”
},
UIApplicationExitsOnSuspend = true,
UIStatusBarHidden = true,
CFBundleDisplayName = “Catchem”,
UIInterfaceOrientation = “UIInterfaceOrientationLandscapeLeft”,
UISupportedInterfaceOrientations =
{
“UIInterfaceOrientationLandscapeLeft”,“UIInterfaceOrientationLandscapeRight”
},
}
}
}[/lua] [import]uid: 22737 topic_id: 11423 reply_id: 41389[/import]

many thanks) can i ask another question?
how to get .isVisible = false image to receive touch events? or i need to use another method for this thing? [import]uid: 16142 topic_id: 11423 reply_id: 41453[/import]

Hey darkconsoles,

You can - just add one line of text to the invisible object you still want listening, like this;

[lua]obj.isHitTestable = true[/lua]

With “obj” obviously being your object’s name :slight_smile:

Peach [import]uid: 52491 topic_id: 11423 reply_id: 41482[/import]

thanks a lot, you all such a great people)
can i ask another one?

how to use global variable across multiple modules? i’m trying to write variable in main.lua and then use it on “level1.lua”(or something like that) and its not detecting at all…
i need something like: when i tap button on level1, variable becomes “true” and with that in function in level0 i need to use it to achieve something
hope i making myself clear, english is not my native language, sorry for that again and for bothering you with my stupid noob questions…)
[import]uid: 16142 topic_id: 11423 reply_id: 41483[/import]

Hey
Just omit the local before the variable

local globalvariable = “hey hey”

to

globalvariable = “hey hey”

and that makes that global
[import]uid: 22737 topic_id: 11423 reply_id: 41488[/import]

oh, that easy? that means i did something wrong in my functions…

anyway, many thanks for you help [import]uid: 16142 topic_id: 11423 reply_id: 41524[/import]

If in doubt, or have issues with global variables when using director, add _G. to the start.

_G.myVariable = 1

Peach :slight_smile: [import]uid: 52491 topic_id: 11423 reply_id: 41668[/import]

thanks again) that _G. thing is working good
another question if you dont mind?

can i somehow put display object(and/or functions) in a table and then display(use)them in order i need or just one of them from that table?

i did that code, but i thinks thats not the right way to do things…

t = {} t[1] = display.newRect(100,100,30,30) t[1].isVisible = false local function something() t[1].isVisible = true end something()

thanks for help [import]uid: 16142 topic_id: 11423 reply_id: 41694[/import]