Newest Fastest Macbook Pro has a serious Simulator display problem

After researching my code, it seems that some FONT OBJECT DISPLAY code for displaying quickly on iOS will not work in the Mac Simulator. Has anyone else seen this problem?

I’m concerned that the same will be true on the fastest Android and iOS devices - I’ll have to find out.

But in Simulator, this is a real problem that needs to be looked into.

I’m not sure what you’re asking / saying.  

Are you saying some fonts do not work in the simulator on your Mac?

Or are you saying they look different on iOS when you publish?

Can you find the Corona simulator icon in the /Applications/Corona-nnnn folder, right-click ( or ctrl-click ) and choose “Get Info” and let me know if “Open in Low Resolution” is checked or not?

Rob

@Rob, the “Open in Low Resolution” checkbox is NOT checked for Corona Simulator in the most recent build 3319.

I checked it and there was no apparent change in the Simulator’s behavior that relates to my issue.

I still don’t understand the post.  What does this mean: “FONT OBJECT DISPLAY code for displaying quickly”?

I have narrowed the issue down to display.capture - it’s likely not related to the font, except that my code was merging numerous  images into a single group.

I’m creating a very small sample to show you the problem.

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:

  1. Create a new project with NO config.lua
  2. 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’ }, },
    }
  3. make sure to create a Default-Landscape.png file
  4. 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.

This would be much more helpful if you put it together and put it in a .zip file and provide a download link to the file. I really can’t take this to Engineering like this.

The splash screen control is $99/year and has to be renewed each year. It is not deprecated. Also keep in mind, deprecated means “it works for now, but may not work in the future”, but even with that definition, it should be working and not deprecated.  The splash screen control plugin should have no effect on the simulator. It’s interesting that it has any effect at all.

Why don’t you have a config.lua? Does having a config.lua change the behavior?

Thanks

Rob

Hi Rob,

  1. Download the zip from www.mrgreatlife.com/Archive.zip

  2. If you want, you can use the HelloWorld config.lua - no change in behavior.

  3. I really do appreciate you getting the team on this right away. I cannot reliably test/check my game code in many places where display.capture is used on simulator - I use it in more than half a dozen places.

  4. when do I have to renew the $99/yr? Will I get a notice before it is shut off? I thought it has already been a year.

Is there a reason you are not using a config.lua?

As for the splash screen, you would probably get a message during building that you’re not subscribed to the plugin. I can’t look that information up, you will need to email support AT coronalabs.com and ask them to look it up for you.

Rob

I wish you had not re-written your top post. What are your MBP specs again?

And can you provide a description or screenshot of what you’re seeing vs. what you should be seeing? 

I see three lines of text. I need to tell the engineers what a failure looks like.

Rob

@Rob, I’m running:
macOS High Sierra, Version 10.13.4

MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports)

Processor 3.3 GHz Intel Core i5

Memory 16GB 2133 MHz LPDDR3

Graphics Intel Iris Plus Graphics 650 1536 MB

  Model Name:    MacBook Pro
  Model Identifier:    MacBookPro14,2
  Processor Name:    Intel Core i5
  Processor Speed:    3.3 GHz
  Number of Processors:    1
  Total Number of Cores:    2
  L2 Cache (per Core):    256 KB
  L3 Cache:    4 MB
  Memory:    16 GB
  Boot ROM Version:    MBP142.0173.B00
  SMC Version (system):    2.44f1

This was purchased on June 1, 2018 directly from Apple. It is their latest model.

Can you provide a screenshot of what you’re seeing?

In this screenshot, you can see 2 lines of text. If you comment-out the plugin in build.settings, you will see 3 lines of text.

Troy,

I’m looking at your code and was wondering.  Can you try this for me:

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 -- CHANGE BEGINS timer.performWithDelay(60, function() display.remove(dispObj) end ) -- CHANGE ENDS return img end

I have found that deleting the the same frame as a display.save() or capture() sometimes causes issues.  Waiting one or two frames usually does the trick.

Also, FYI, this is unnecessary:

dispObj=nil 

That variable is temporary so you don’t need to clear it.  It will go away and clear its reference to the object as soon as the function ends.

You may be wondering, yeah, “but why does the behavior change when I comment out plugin”.  Probably a timing change is all. i.e. Just random luck that helped you encounter the issue.

I seriously doubt the plugin itself has any effect on the rendering of text, especially since it doesn’t run or do anything in the simulator.  Its possible, but … well let’s see what the delay I suggested does for you.

@roaminggamer, thanks for your time on this. I had already ruled out the delay, but I tested your recommended change anyway. No luck. I also changed it to a higher value, too - nothing different.

@Rob, I commented out the display.remove line just to see what would happen - please notice that you can see the corruption of the original text of the first line.
 

@Corona, what’s up with this issue? Can’t you duplicate it? Although my example is simple, this happens all over my app and it looks as if it is poking into random memory - as I said, even once caused a hard crash on my Mac. Something in how the graphics are being displayed - its very serious. Sometimes, Corona just sits for 5-10 seconds with the wheel spinning in simulator, too. Please help.

And nearly every button has its edges corrupted in my game, even the game title is corrupted.