Resolution issues

I created an app with 2048 x 1400 resolution.

It is normal in simulator.

However, when you build with the app, the size doubles.

config.lua

[lua]

application =

{

content =

{

fps = 60,

width = 2048,

height = 1400,

– scale = “zoomEven”

}

}

[/lua]

build.setting

[lua]

settings =

{

    macos =

    {

        bundleResourcesDirectory = “osx-resources”,

    },

    window =

    {

        defaultViewWidth = 2048,

        defaultViewHeight = 1400,

        enableCloseButton = true,

        enableMaximizeButton = false,

        resizable = false,

        – defaultMode = “fullscreen”,

    },

}

[/lua]

Hi.  Let me suggest that you use ‘adaptive’ scaling.

However, be aware that no matter what you do, the simulator will never truly reflect the what a desktop build will look like.

Note: If anyone disagrees and has a concrete example, please show me because this is something I struggle with too and I make a lot of tools as desktop apps, so I would love to have a 1-to-1 setup that works.

Hi @roaminggamer

I understand what you say.

But the problem I’m talking about is a little different.

Just create a “hello world” sample,

You can test this with the same settings as my [config] and [build].


my macbook display

12-inch (2304 x 1440)

Simulator

app

The simulator is likely showing at 50% zoom level. A good CMD + will likely make the simulator mirror the compiled desktop version.

Rob

@Kim - I wouldn’t actually use those settings. That is effectively scaling set to ‘none’ IIRC.

Also, Kudos to @Rob.  I forgot that detail.   

If your simulator is scaling, you will also see non-matching resolutions.

i.e. If you select a display resolution higher than your screen size for the simulator (don’t forget you have to add the borders of the simulator too), OR as Rob dully noted, if you’ve scaled your view, you will see something different that normal scaling.

Just for giggles, please try swapping these values in build.settings:

defaultViewWidth = 2048, -- make this 1400 defaultViewHeight = 1400, -- make this 2048

This probably isn’t true now, but … these used to be swapped or rather I think the screen was treated as if those were for portrait, so landscape (which is 99% of monitor orientations) would need the values swapped.

@Kim,

I forgot to ask, but what simulated device view are you using when viewing your app in the simulator.

You should probably use a ‘Custom Device’ view and be sure to select either macOS or Windows as the Platform.

Thanks for reply.

I made this a few months ago,

If [build] setting to 1024x700, there is no problem in using privately.

But, The font was not clear. I left this as a known issue.

@Roaminggamer

I tested ‘Custom Device (2048x1400)’ The screenshot is it.

@Rob

I think this is a different than what you are talking about.

I set to 2048x1400,

The binary was created with 4096x2800.

This is a kind of bug.

p.s: attached sample file.

p.s2: I use MacBook (Retina, 12-inch, Early 2015)

Don’t forget to tell us what version of Corona you’re using.

Version 2017.3173 (2017.11.12)

@roadminggamer

You do not have a problem, do you? @_@

This is the problem:

application = { content = { -- fps = 60, width = 2048, height = 1400, -- scale = "letterBox" } }

Should be (your application is landscape so you need to flip the height and width values):

application = { content = { -- fps = 60, width = 1400, height = 2048, -- scale = "letterBox" } }

Also, you’re missing the orientation section of your build.settings file:

local orientation = 'landscapeRight' -- portrait, landscapeRight, ... settings = { orientation = { default = orientation, supported = { orientation }, }, macos = { bundleResourcesDirectory = "osx-resources", }, window = { defaultViewWidth = 2048, defaultViewHeight = 1400, enableCloseButton = true, enableMaximizeButton = false, resizable = false, -- defaultMode = "fullscreen", }, }

Are you asking if I saw the same issue?  Yes, but then I resolved is as noted above.

@roaminggamer

um… I think it is definitely a bug.

If you did not have any problems when testing with binary(.app),

I think it appears in my MacBook. So I mentioned earlier that I use a MacBook.

I set up [config] and [build] the same as you (attached file),

and then created the binary.

The result is this screenshot.

Note: I built with version 3082 because that is what I have set up for my client projects.

Let me try 3173, then  I’ll attach my project and a binary for you to test.  

Note: I used 800x600 as the resolution, because my monitor is 1920x1080 so I can’t run a 2048 x 1400 app at full resolution anyways.

Back in a bit.

Zip File: https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2017/11/desktop.zip containing:

Virtual Mac Setup
vmac.png
 
 
3082 Screenshot
3082.png
 
31730 Screenshot
3173.png

@roaminggamer

I knows 800x600 was work fine. but It is not the point I want to say.

At 800x600, There is no need to consider “orientation”. (In fact, I do not think orientation is necessary for desktop apps.)


@Corona

I have already created a program of size 2048x1400.

And when I made it into binary, I knew that it would double in size. (It is the point I want to say.)

I had to set the size to 1024x700 to make it a binary of 2048x1400.

And I had to take the disadvantage that the font looked blurry.

I’m just trying to tell you this.

I can’t help much longer with this.   

I’m not sure now if you’ve tried to use my modified sample project or not.  Just use it directly if you haven’t.  Then, modify it as shown below if it works in 800x600 mode.

  1. Did you build and run the project code I supplied (your modified code)?
     
  2. If yes, did it work?
     
  3. Then, did you modify the 800x600 values in build.settings and config.lua to replace 800 with 2048 and 600 with 1400?
     
  4. When you built and ran that, did it work?
     
    I’m simply having trouble with the idea that 800x600 works, but changing that to 2048x1400 doesn’t.  
     
    Be sure you have these things correct:
  • build.settings
    • Must have an orientation section set to landscapeRight (see below)
      • Yes, this is important.  Otherwise, the simulator won’t know how to orient.  Just try my modified sample instead of arguing.
    • Must have window section with defaultView Width/Height as show below
  • config.lua - width and height as shown below
  • Custom Device Settings In Simulator
    • Screen Width 1400
    • ScreenHeight 2048

build.settings parts:

 orientation = { default = 'landscapeRight', supported = { 'landscapeRight' }, }, window = { defaultViewWidth = 2048, defaultViewHeight = 1400, enableCloseButton = true, enableMaximizeButton = false, resizable = false, -- defaultMode = "fullscreen", },

config.lua:

application = { content = { width = 1400, height = 2048, } }

Keep in mind, config.lua is not a measure of pixels. It’s a measure of content points that represent your virtual screen.  You could do a width of 10 x 15 if you wanted and it would still fill the screen.

In build.settings you set the default window size. The docs are not clear, but this is probably a pixel setting, though it suggests it should be your config.lua or larger.

Now I don’t know if you are hitting a retina display bug. I don’t have a Mac with a Retina display, but it’s likely that Corona is detecting you have one and doubling the resolution.  Now are you building this just for you or do you plan to distribute it to others? Many people don’t have screens that large.

Rob

I do not know how many times I say.

This is a bug in my MacBook.

And I am not trying to solve it.

It is just to inform you of this situation.

@roaminggamer

  1. Did you build and run the project code I supplied (your modified code)?
  • Yes
     
  1. If yes, did it work?
  • Yes
  1. Then, did you modify the 800x600 values in build.settings and config.lua to replace 800 with 2048 and 600 with 1400?
  • Did
  1. When you built and ran that, did it work?
  • No

Is there a difference between your question and the sample attached at this time?