Please take just a few moments to recreate this bug and see how it is fixed - but then, dive deeper to see that I’ve only uncovered one symptom of a larger issue.
A) The problem is definately display.capture. Do you have a way to thoroughly test it in Simulator to find the problem?
B) This next question is only related to the CoronaSplashControl plugin, which is NOT the problem, but disabling it does solve the problem in ONE case - in the example below. Read my full explaination in section 4. Is the CoronaSplashControl plugin deprecated? if not, I’ve only purchased it one time when it went into effect - but it says $99/year. And when I log in, it says it is Activated. It is really $99/one-time?
To recreate this bug, do the following:
- Create a new project with NO config.lua
- use this for a simple build.settings file:
settings = {
splashScreen = { ios = { enable = false }, android = { enable = true, image = “Default-Landscape.png” } },
orientation = { default = “landscapeRight”, content = “landscapeRight”, supported = { “landscapeLeft”, “landscapeRight”}, },
plugins = { [‘plugin.CoronaSplashControl’] = { publisherId = ‘com.coronalabs’ }, },
}
- make sure to create a Default-Landscape.png file
- Here are the 36 lines of code for main.lua to recreate the problem - this should display 3 lines of text, but it only displays 2 lines. If you comment out the plugin, all 3 lines appear properly. What is strange, however, is that now when I go to my larger application and take out the plugin or splash code, the problem still exists. This tells me that in this sample, the display.capture is still defective on MacOS and even though it can be solved by taking out the plugin in this example, the underlying problem remains.
–=======================================================================================
local snapIdx=0
local img
local function toSnapObj(dispObj, x, y)
if system.getInfo(“platform”)==“Android” then
snapIdx=snapIdx + 1
if snapIdx == 500 then snapIdx=1 end
local fileName=“tmp”…snapIdx…".png"
display.save(dispObj,
{
filename=fileName,
baseDir=system.CachesDirectory,
captureOffscreenArea=false,
backgroundColor={0,0,0,0}
})
img=display.newImage(fileName, system.CachesDirectory)
else – iOS and Simulator on Mac OS
img=display.capture(dispObj, {captureOffscreenArea=true})
end
img.x=x
img.y=y
display.remove(dispObj);dispObj=nil
return img
end
–=======================================================================================
W=display.viewableContentWidth; H=display.viewableContentHeight
local font=native.systemFont
local fontSize=H*0.08
local x=W*0.50; local y=H*0.25
local text_D=display.newText(“This is a test”,x,y,font,fontSize)
text_D=toSnapObj(text_D,text_D.x,text_D.y)
local text2_D=display.newText(“This is another test”,x,text_D.y+fontSize,font,fontSize)
text2_D=toSnapObj(text2_D,text2_D.x,text2_D.y)
local text3_D=display.newText(“This is YET another test”,x,text2_D.y+fontSize,font,fontSize)
text3_D=toSnapObj(text3_D,text3_D.x,text3_D.y)
– if you are wondering why I am doing this with these text objects, it’s because my code actually does this with a group of numerous text shadows to create a single shadow object. In this sample, no shadow is necessary to see the missing object.
– I am also converting hundreds of tiles into a single game board object using this technique, which significantly improves performance for my game board which is dynamically generated.