Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Window size when built ignores config.lua
Started by guriek Jun 21 2019 01:22 AM

1 reply to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

guriek

[GLOBAL: userInfoPane.html]
guriek
  • Enthusiast

  • 34 posts
  • Corona SDK

Hey,

 

The problem I have is that the config.lua section has 540x960, but when i build the app for windows the actual size is 480x740.

 

This is my config.lua:

 

--calculate the aspect ratio of the device:
local aspectRatio = display.pixelHeight / display.pixelWidth
local orientation = 'portrait' -- portrait, landscapeRight, ...
print(aspectRatio)
application = {
   content = {
      width = aspectRatio > 1.5 and 320 or math.ceil( 480 / aspectRatio ),
      height = aspectRatio < 1.5 and 480 or math.ceil( 320 * aspectRatio ),
      scale = "letterBox",
      fps = 30,

      imageSuffix = {
         ["@2x"] = 1.5,
         ["@4x"] = 3.0,
      },
   },
   orientation = {
        default     = orientation,
        supported   = { orientation },
    },
   window = {
        defaultMode = "normal",
        defaultViewWidth = 540,
        defaultViewHeight = 960,
        suspendWhenMinimized = true,
        resizable = false
    },
}

 

Can't find what I'm doing wrong.



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,255 posts
  • Corona SDK

Hey @guriek,

Orientation and window parameters belong to build.settings. For window settings specifically, check out https://docs.coronalabs.com/guide/distribution/win32Build/index.html#window-settings




[topic_controls]
[/topic_controls]