Change layout width and height at runtime

Get help using Construct 2

Post » Tue Sep 04, 2012 11:37 pm

You can set the width and height of the layout at runtime(from the events?).
I see that you can set the canvas size, but you can change the layout size?

Thanks!
B
6
Posts: 19
Reputation: 713

Post » Tue Oct 02, 2012 9:49 pm

Bump? lol

If you're trying to build a real desktop game then being able to change the resolution is a pretty standard (and expected) feature.

Any possibility of this happening?
B
3
G
1
Posts: 8
Reputation: 591

Post » Tue Oct 02, 2012 9:55 pm

@DLZ: This tutorial is what you need to read and do

@gonpla: There is no way to change the layout size at runtime.
You don't really need it normally.
A useful trick might be to go in the layout proeperties and set "Unbounding scrolling" to "Yes".

May or may not be useful, it depends on the game you're making.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Tue Oct 02, 2012 11:06 pm

Another option is to use crop fullscreen mode. Then your canvas is the maximum size possible, you have entire browser window to play with. You can make a massive background (e.g. from a single pixel tile), then put your game anywhere on it by moving your objects, incl. level backgrounds around. You can put sprites and text objects into two different families, then use bullet behavior on them to move them, or pin all your objects to a background and move that. you can also set the layer scale to make the game bigger or smaller without having to do anything (this is basically letterbox scaled mode but with the ability to set your own background colour)
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Wed Feb 20, 2013 1:44 pm

The proposal of nutmix is interesting. I'd like to go that way, because I think that to have flexible screen resolution is important and really needed feature.

It would be very appreciated to have integrated functions in C2 to "detect" the users browser and screen resolutions and to have the possibility to "set" the window size to that.
B
11
S
3
G
3
Posts: 79
Reputation: 3,343


Return to How do I....?

Who is online

Users browsing this forum: makkancs, Matthew de and 27 guests