Hi
I am trying to use the new container object in order to mask the screen but I am facing problem to do so. In order to display the core of the problem attach 2 code examples with the screen layout.
I am running the example on the corona simulator (2014.2189) on Windows 7.
When I am running the folowing line:
local myBox = display.newRect(160,284, 100, 50 )
All is well and a white rectangle is position on the middle of the screen (Refer to attach file : Picture1)
But running the following lines:
local myBox = display.newRect(160,284, 100, 50 )
local container = display.newContainer( 320 , 568 ) --Define the container for the whole screen size
container:translate( 160, 284 ) – Locate the containeron the center of the screen
container:insert(myBox)
The white rectangle is push into the lower right side of the screen. Why ? (Refer to attach file : Picture1) I would like to assume that if I create container on the whole screen it will not rearrange the location of the display objects. How can I use the container and maintain the same original location/size of the objects (i.e. prior adding the objects to the container)
Also Attach the config.lua file:
application =
{
content =
{
width = 320, --Default to Iphone 5 Scale (Original 640 * 1136)
height = 568 ,
scale = “letterBox”,
xAlign = “center”,
yAlign = “center”,
imageSuffix =
{
["@2x"] = 1.5
--["-small"] = 0.375,
--high-resolution devices (Retina iPad, Kindle Fire HD 9", Nexus 10, etc.) will use @2x-suffixed images
--devices less than 1.5*height pixels in width (iPhone4, iPad2, Kindle Fire 7", etc.) will use non-suffixed images
},
fps = 30 --Defult Can be changed to 60
}
}