How the scale the complete window of the game?

0 favourites
  • 9 posts
From the Asset Store
Get Ready for the New Wave of "Bottom Screen" Games!
  • 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?

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

  • 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.

  • 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?

  • Yeah, maybe a bug then - does it work properly in C2?

  • 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 ...

  • 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... ?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)