hello,
I am trying to auto select images in my game but I have a problem doing it because It seems like the images are not being recognized, I have set the key pair values in the config file as well as check the images name in the game folder but I doesn’t look like is working I got a message saying I am pointing to a null value
the code I got in my config.lua is the following:
system.getInfo(“model”)
if ( string.sub( system.getInfo(“model”), 1, 4 ) == “iPad” ) then
application = {
content = {
width = 768,
height = 1024,
scale = “letterBox”,
fps = 30,
imageSuffix = {
["@2x"] = 0.375,
["@4x"] = 1.5,
}
},
--[[
– Push notifications
notification =
{
iphone =
{
types =
{
“badge”, “sound”, “alert”, “newsstand”
}
}
}
--]]
}
else
application = {
content = {
width = 720,
height = 1280,
scale = “letterBox”,
fps = 30,
imageSuffix = {
["@2x"] = 0.375,
["@4x"] = 1.5,
}
},
--[[
– Push notifications
notification =
{
iphone =
{
types =
{
“badge”, “sound”, “alert”, “newsstand”
}
}
}
--]]
}
end
The code of my game that is calling the images is the following:
local background = display.newImageRect( “mysplash_screen.jpg”, display.contentWidth, display.contentHeight )
background.anchorX = 0
background.anchorY = 0
background.x, background.y = 0, 0
and the 2 images I got in the game folder are named:
mysplash_screen@2x.jpg
mysplash_screen@4x.jpg
the line local background = display.newImageRect( “mysplash_screen.jpg”, display.contentWidth, display.contentHeight ) is the one I am getting the error from but if I change the name of the image to match the ones I got in the folder named like the ones above starts working so I guess sht is wrong with the dynamic Image selection.
I do really need help to fix this issue
Regards.