How the scale the complete window of the game?

Get help using Construct 3!

Post » Fri Jun 16, 2017 6:25 am

Hello,

I'm searching for a solution how to scale the complete window of the game (on the PC) without increasing the viewport, in other words, the pixels should scale als well.

Scaling the layers works fin, but without a corresponding change of the window, it's only a zoom effect, which is nice, but not the thing I wanted to achieve.. :)

I tinkered around with the viewport size etc., but to no avail...

And yes: I want to scale the window, not switch to fullscreen.

Any suggestions?
B
16
S
6
Posts: 26
Reputation: 1,221

Post » Fri Jun 16, 2017 8:37 am

Have you tried "Set Canvas Size"? If you then want the pixels to scale correspondingly you can set the Layout scale.
Last edited by mekonbekon on Fri Jun 16, 2017 9:29 am, edited 1 time in total.
B
22
S
9
G
4
Posts: 476
Reputation: 4,327

Post » Fri Jun 16, 2017 9:25 am

mekonbekon wrote:Have you tried "Set Canvas Size"? If you then want the pixels correspondingly to scale you can set the Layout scale.


I'm pretty sure I did just that already .. it was even one of my first thoughts... didn't work out as planned, but I can check again.
B
16
S
6
Posts: 26
Reputation: 1,221

Post » Fri Jun 16, 2017 12:53 pm

I checked the "Set canvas size to.." action, but it's not doing anything.

Setting the layout scale in the same event works fine, so the action should get triggered because the layout scale setting action and the "Set canvas size.." action are in the same event.

No visible reaction regarding the canvas size during preview AND in debug mode.

I can see in the debug window that the System.Canvas properties aren't changing at all if the action gets triggered.

The properties ARE changing if I'm resizing the window with my mouse though....

Any ideas?

UPDATE: Well, there's even a tutorial for this topic.. https://www.scirra.com/tutorials/1258/c ... resolution But this is the very thing I tried to no avail... A C3 bug?
B
16
S
6
Posts: 26
Reputation: 1,221

Post » Fri Jun 16, 2017 5:18 pm

Yeah, maybe a bug then - does it work properly in C2?
B
22
S
9
G
4
Posts: 476
Reputation: 4,327

Post » Mon Jun 19, 2017 7:23 am

mekonbekon wrote:Yeah, maybe a bug then - does it work properly in C2?


Not sure.. C2 is quite different, you can choose the preview browser in the project settings, but for every browser except NW.js, the layout starts as a new tab of the selected browser
with the last active window size as far as I can see... so the size of the canvas is already different to begin with.

NW.js starts with the original settings for the canvas and the layer, but doesn't care about scaling of the canvas at all.

So, hard to compare C2 and C3 at the moment.

C3 doesn't seem to have the browser setting for the project at all, maybe because it's more Chrome orientated at the moment.. I don't know for sure.

Still, It's unclear to me if and when "set canvas size" does anything ...
B
16
S
6
Posts: 26
Reputation: 1,221

Post » Mon Jun 19, 2017 2:03 pm

Well, what DOES work indeed is using the Browser object and using the "execute Javascript" method... and calling the "resizeTo(width, height) "method there so the window rescales..

(of course with some helper variables and stuff, but nethertheless..)

But you have to avoid using the set layout scale method altogether in this case.. it works, but somehow this feels more like an ugly hack... ?
B
16
S
6
Posts: 26
Reputation: 1,221

Post » Mon Jun 19, 2017 5:27 pm

@UncleHo74

Thanks for posting your solution, handy to know. It does seem as though something's going a bit squiffy with Set Canvas Size - maybe log it as bug, at least you'll know for sure whether it's working as intended.
B
22
S
9
G
4
Posts: 476
Reputation: 4,327

Post » Thu Jul 27, 2017 7:49 am

Sorry for the late answer.. yeah, maybe I will log it as a bug, but have to recreate it first, it has been a while...
B
16
S
6
Posts: 26
Reputation: 1,221


Return to How do I...?

Who is online

Users browsing this forum: No registered users and 0 guests