Best way to actually support multiple res?

Get help using Construct 2

Post » Thu Dec 19, 2013 4:10 pm

Perhaps these image will make it a bit clearer:



The one on the left is the only simple available option ATM, and I'm looking for a way to implement the option on the right.



Does this make it clearer?sqiddster2013-12-19 16:11:39
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Mon Dec 23, 2013 8:45 pm

*bump*
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Mon Dec 23, 2013 10:01 pm

@sqiddster

I might have misunderstood the question but doesn't the "set canvas size" action already do what you want?

As in
Event-->On start of Layout
Action-->Set canvas size to WindowWidth x WindowHeight

I believe this takes your current window size and sets the canvas size to the window size.

You could take the WindowWidth and WindowHeight and adjust it by subtracting by some value or divide by some value to scale down its resolution.

You could maybe also switch out the value of WindowWidth with viewportRight("layer"), and WindowHeight with viewportBottom("layer") to get the devices viewport on the browser then adjust the canvas to the viewport.


Do you think that might be what your looking for?retrodude2013-12-23 22:07:27
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Mon Dec 23, 2013 11:21 pm

@retrodude yeah, that's part of the solution. The other part is making the game window the same size, regardless of the set resolution. The game's been designed at a 1366x768 resolution, so if I set the canvas size to, say, 1280x720, the game's going to have to adjust.

I thought using 'set layout scale' would work but it's not really working for me.

I guess I'll have to build in multi-resolution support for all the menus, HUD, etc.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Tue Dec 24, 2013 12:30 am

@sqiddster

Oh I see what you mean now. As of right now I don't think its possible to directly change the game window size with scaling on. You can however change the game window size when scaling is set to "off" by using both layer scale and set canvas size. For some reason layout scaling doesn't seem to work the way I thought it did.

Here's a capx to show you what I mean:

Press "a" to scale down by half

https://www.dropbox.com/s/wj3fvhfysetjyu3/scaling.capx

B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Tue Dec 24, 2013 12:39 am

@retrodude

yeah, I was just going to reply. I've found a solution, but it only works with 'fullscreen in browser' to 'off'.

Basically, after setting the canvas size to the desired resolution you set the layout scale to 'newresolution/gameNativeResolution'.

I have no idea why it only works with 'fullscreen in browser' set to 'off'. @Ashley perhaps you could shed some light on the subject?
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Tue Dec 24, 2013 1:51 am

@sqiddster

Oh alright

I think the point of scaling is to take whatever game window size you have and just scale it up to the browser window size, so even if we could change the game window it would still scale up to fit the browser window using the extra space provided in the layout as a filler. I guess when we scale down using the set canvas and layout size actions when scaling is off, something has to be used as filler to cover the areas appearing outside the layout. And that would be the colour of the layout we assign in the C2 editor.

We would probably need a new form of scaling for this. Maybe something like Adjustable Scale, where you can choose your resolution, and then the layout and canvas size would scale to those values leaving black spaces as the filler.
retrodude2013-12-24 01:57:59
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Tue Dec 24, 2013 2:28 am

I modified your capx and I'm pretty sure it's a C2 bug, as the layout is weird even when the scale/canvas size are returned to normal.

I filed a bug report. Here it is, if you're interested.sqiddster2013-12-24 02:28:55
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Previous

Return to How do I....?

Who is online

Users browsing this forum: khelaghor, R0J0hound and 8 guests