macos window size/resolution question (from Android guy)

Hi, New to building Solar2D apps for the Mac (all my prior efforts are Android).

My most recent Android app is capable of building/running on macOS, but on the Mac the window size I get is 640 wide by 967 tall. I want to have a window with more resolution, at least 1100 in height.

I’ve tried things like “… settings = { … windows = { defaultViewHeigth = 1200 …} }” (copy/pasted from a solar2d site page) in build.settings, but:

1. build for Android complains they are unknown values

2. they had no effect on my Mac app.

I can’t figure out how to say “this setting is for macos, don’t look at it on Android” (indenting with “macos =” simply adds another layer to the warnings :slight_smile: )

As usual, I’m puzzled about the different between config.lua and build.settings.

I have tried doing a native window resize as the first executable line of Lua code on the mac … the on-screen window indeed gets the size I want, but the mac app still only sees the same roughly 640x967.

I should mention that to a large degree I don’t want a scaled environment … I prefer to have native resolution and then scale myself. Also, if it matters, I don’t use “scenes” or “director” (?).

thanks in advance!

Just to double check. You wrote:

build.settings:

settings =
{
	windows =
	{
		defaultViewHeigth = 1200,
	},
}

If those aren’t just typos here in the forums, then there’s your culprit. They’re window and defaultViewHeight. You’ve written windows and defaultViewHeigth. That would also explain the warnings in the console when you build.

Sounds odd that you’d receive warnings from indentation? Solar2D should just be checking that you don’t have any unexpected properties in the table. It shouldn’t care about indentation. I don’t think you should be seeing any warnings about macos properties when building for Android either.

The difference between config.lua and build.settings is that config.lua is read when the app launches and it’s where Solar2D gets the app’s content area, scaling, FPS, and other Runtime values. The build.settings file is only used when Solar2D builds the app, i.e. it contains the build instructions for the engine.

I just tested on my macOS and I didn’t have any issues with this test build.settings file:

settings =
{
	-- .... your other build settings, and then

	macos =
	{
		plist =
		{
			NSHumanReadableCopyright = "Your copyright"
		},
	},

	window =
	{
		titleText = {
			default = "Your app",
		},
		defaultMode = "normal", -- "normal", "minimized", "maximized", "fullscreen"
		defaultViewWidth = 1920,
		defaultViewHeight = 1080,
		minViewWidth = 320,
		minViewHeight = 480,

		resizable = true,
		enableCloseButton = true,
		enableMaximizeButton = false,
		enableMinimizeButton = true,
		suspendWhenMinimized = true,
	},
}

As for your issue with the screen dimensions not changing, are you obtaining that information using display.actualContentWidth and display.actualContentHeight? If you aren’t then switch to them.

1 Like

Hi,

Could very well be typos … will go back and try again, thanks!

The thing that I’ve found that I get the most problems with in Solar2D is silent errors (particularly with “img.fill = …fill info…” :slight_smile:

I’ve been using the “safe” versions (display.safeActualContentHeight, for example), because that excludes screen area I shouldn’t use (on those devices that might reserve some area).