Camera size issue

I have a scene with two layers, the default layer for the game and one above it for the GUI. The default layer uses absolute (pixel based) sized objects (technically nothing is resized using code they are all default size as defined in sprite editor, etc.) while the GUI is using relative sized elements (created and sized using code) so to scale according to the display size of the user’s device.

At start
Full screen is turned OFF
Screen width and height are saved to global variables
Window is resized to screen width and height
Full screen is turned ON

Then the GUI is drawn using relative sizing and positioning based on the saved global variables of screen width and height. The GUI is placed where it should be. So far so good.

However the default layer does not work properly. What I’ve discovered is the camera size stays the same that is defined as window width and height at the project parameters (right click on project title in the project manager and choosing “edit properties of the game”).

Tested NOT activating full screen and the game window is sized as intended (to actual device / screen size) so there is no issue with that. Yet still the camera of the default layer seems to be the same size as the default window width and height properties defined in the project settings.

It is evident something is wrong because at start the game centers the default layer camera on the player. This only works as intended when the project properties have the same default window size as my screen size but when it is larger or smaller the player is not at the center of the screen, instead in the center of the virtual size of the project default width and height as if the actual camera is smaller.

I’ve tested it both in preview mode and compiled the game into native (.exe) format then ran the executable and the result is the same both cases.

:question: So is there any way to change the actual camera width and height instead of just the window size?

(I’ve found no function for this but read something about camera width and height when I did my forum searches so maybe it was a function in earlier versions which is no longer included.)

:question: And if that is not possible currently is it possible to have that function included in the near future?

:question: Or is there any other way to solve this issue?

:bulb: I’ve made a mockup to illustrate the issue:

As you can see the camera size does not change even if the window width and height is altered using code instead stays at the default (original) value set at the project properties.

Not sure if this is intentional but there should be an option to alter the camera size as well or even better would be to be able to set camera width and height at runtime.

Let me know:
If this is how it should work because then I will submit a feature request for this.
If this is an unintentional behaviour because then I will submit it as a bug report.

And also let me know if there is any solution to this issue at the moment.

Sorry I don’t have your answers with regard to camera sizing. However, I do all camera ‘resizing’ by changing the camera zoom. By having your GUI on a separate layer, changing the camera zoom can give you lots of control over what you see.

The very first sentence of my first post:

So I use that method. However I use zooming as part of my game so is no option to solve this issue… and it shouldn’t be anyway as how it currently works is surely not how it should be. Besides it also does not solve the issue that the center point of the camera being at a different location depending on display device screen size instead of the window’s actual current size how it should be… or at least there should exist an option for this. Furthermore what you suggest is a no go because…

Another issue I recently noticed is that objects disappear outside the virtual camera. This means objects are not rendered and disappear “mid” screen. I guess the reason is that the camera renders objects until they go out of view from the camera then they are not rendered anymore so if the virtual camera size is smaller than the window’s current size (the device’s display screen size) then objects are not rendered when they fully exit the virtual camera size.

:arrow_right: I have attached a sample project using assets from the soldier example. You can move the camera around and by doing so you can see how objects disappear “mid” screen:

camtest.zip (5.57 KB)

Although this may be how the camera rendering should work it still shows how the size of the camera is an issue and causes problems if the camera’s actual size can not be altered through code and as I need the zoom function for my game it is no solution for the problem. I think the zoom function isn’t intended to be used for such purposes anyway although even if that is intentional I think a pair of variables should exist to can alter the camera width and height at runtime as needed.

I’ve checked this and the zoom function actually does not solve the rendering issue so regardless if the camera is zoomed in or out objects disappear “mid” screen anyway because the camera size does not change thus does not fill the window resulting in objects going outside the camera to disappear.

There’s an action to change the camera size of a specific camera of a specific layer (called “Change camera size”). Just do this change for all your layers and their camera “0” (it’s the default camera of each layer).

That action is only available for native games but I am developing a mobile game (and also a web version and only later may make a native version) so that action is not available on the current platform.

Edit: If there is a nightly build or test version or such that has that feature let me know and I give it a go even if it is considered an unstable / not confirmed to be stable version as of yet.

Although it is not urgent for now but later once my game nears its completion I would need this feature so beta testing can be done properly.