Config.lua and dynamic stuff

I am trying to add on some work I created in Kwik to my game, however, I just discovered that Kwik generates all its graphics to the following config:

[lua] application =
{
content =
{
–zoom
width = 640,
height = 960,
fps = 60,
scale = “zoomEven”,

imageSuffix =
{
["@2"] = 2,
}
}
} [/lua]

…and I’m using:

[lua]application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
fps = 30,

imageSuffix =
{
["@x15"] = 1.5,
["@x2"] = 2,
},
},

}[/lua]

I thought it might be a simple case of putting a variable in the main.lua file like 'setScale = false" and a “setScale = true” in my kwik page and create an if/else statement to switch between the two but the config.lua file doesn’t seem to see any of this. So I’m a bit stuck.

Does anyone know how to do an if / else statement in the config.lua file based on a variable in another module? Or is there a way to see when a module is loaded?

– Chris [import]uid: 33866 topic_id: 10848 reply_id: 310848[/import]

Having boggled my mind, I don’t think there is a solution. I’ve even tried having an event listener running at runtime to try and switch the setting with no joy.

I think the only real solution would be to change my game setting to run with Kwiks config.lua… which will have to wait till my next game since I’m almost finished and to change everything now would undo a lot of work.

Unless someone out there has a magical alternative that I haven’t thought of?

– Chris [import]uid: 33866 topic_id: 10848 reply_id: 39489[/import]

Chris, did this ever get resolved? I’m having zero luck loading graphics according to device (what’s returned by system.getInfo(“model”) because config.lua overrides what I want to do.

For the life of me, I cannot get graphics to display properly on all devices - even when I use the “magic dimensions” Beebe mentions. It’s frustrating to say the least.

I’m trying to load BG graphics that fill the screen for iPad, iPhone, and iPhone4. [import]uid: 74844 topic_id: 10848 reply_id: 49144[/import]