How do I change the layout width and height while in-game?

0 favourites
  • 4 posts
From the Asset Store
Quickly and easily add a Quake-like console to your games
  • I have already found out it is not possible to change the layout dimensions in runtime normally, however, I am asking if there are any ways to work around this?

    I am making a level editor for my game and it would be very handy to be able to change the layout size directly with a slider, with minimum and maximum level sizes.

    One idea is to define my own borders within a layout at max size but that method would be very complicated and tedious to implement for such a basic mechanic, and I'm not sure if it would even work. Not to mention if I ever wanted to adjust the maximum and minimum level sizes it would be a huge task.

    Simply, is there anything I could do to change the layout dimensions in runtime, even with javascript or plugins of some sort?

  • It's okay to have a large size layout and only display part of it, I use it all the time.

  • Why not give the user three choices, small, medium and large -- then switch to whatever size they wanted as a preset layout?

    yours

    winkr7

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One idea is to define my own borders within a layout at max size but that method would be very complicated and tedious to implement...

    I'm not sure why that would be very complicated and tedious. Can you explain the issues you have with that method?

    I think that is your easiest route. Make the layout very large. What is the downside of having large parts of the layout unused?

    You could cover the unused area with a tiled background, block it off with solid objects, or whatever else you need to do, depending on your game mechanics.

    If you are thinking of issues more so with the level editor part, you could set the area of the tilemap, which would stop them from trying to edit the tiles outside the level. If not using a tilemap and something like drag and drop, you could just have an event to check on drop if the dropped position is greater than the level width/height.

    Maybe there is a way to change the layout size now, but I know in the past it was not possible. Even if it is, I'm still not sure how it would make anything that much easier for you here.

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