Resize the Canvas in Runtime

Discussion and feedback on Construct 2

Post » Mon Dec 26, 2016 5:17 pm

Sisyphus wrote:
Zebbi wrote:Did this happen?

Yeah, System > Set Canvas Size

What's the correct way of doubling the resolution to x2 (or tripling to x3, quad with x3, etc) and resizing the height by 1.2 to create old-skool rectangular pixels? Like how they aspect correct in SCUMMVM by doing a scale and changing 320x200 to 320x240 after the scaling?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Mon Dec 26, 2016 7:07 pm

Zebbi wrote:
Sisyphus wrote:
Zebbi wrote:Did this happen?

Yeah, System > Set Canvas Size

What's the correct way of doubling the resolution to x2 (or tripling to x3, quad with x3, etc) and resizing the height by 1.2 to create old-skool rectangular pixels? Like how they aspect correct in SCUMMVM by doing a scale and changing 320x200 to 320x240 after the scaling?

Dunno, i use Fullscreen scaling: Low Quality + 1280x720 canvas size to make my games render faster on these WQHD and 4k mobile phones, same thing as TS requested. Maybe something like Fullscreen scaling: Low Quality + OriginalWindowWidth*2 x OriginalWindowHeight*2 will double the resolution, but not sure about stretch after the scaling.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Mon Dec 26, 2016 7:49 pm

Sisyphus wrote:Dunno, i use Fullscreen scaling: Low Quality + 1280x720 canvas size to make my games render faster on these WQHD and 4k mobile phones, same thing as TS requested. Maybe something like Fullscreen scaling: Low Quality + OriginalWindowWidth*2 x OriginalWindowHeight*2 will double the resolution, but not sure about stretch after the scaling.

maybe doing an extra *1.2 on the height might work?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Mon Dec 26, 2016 8:52 pm

Zebbi wrote:maybe doing an extra *1.2 on the height might work?

Well, it will maybe look how you want it to, but the performance will be really bad, imagine this on 4k display, your game will render on 8k or more, then stretch to screen size. I guess it's not possible in c2 to render the game in one resolution and then stretch it to another resolution, other than screen resolution.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Mon Dec 26, 2016 8:53 pm

Sisyphus wrote:
Zebbi wrote:maybe doing an extra *1.2 on the height might work?

Well, it will maybe look how you want it to, but the performance will be really bad, imagine this on 4k display, your game will render on 8k or more, then stretch to screen size. I guess it's not possible in c2 to render the game in one resolution and then stretch it to another resolution, other than screen resolution.

Hmm, wish I could read proper code and I could figure out how ScummVM does it and try and work that in :D Is GPU scaling still expensive to use?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Mon Dec 26, 2016 10:07 pm

Zebbi wrote:Is GPU scaling still expensive to use?

Nope, but rendering is. Anyway, canvas resizing will not help, you need another way, maybe shaders or effect, or maybe you can try to resize everything in your game to make it look as needed.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Mon Dec 26, 2016 10:21 pm

Sisyphus wrote:
Zebbi wrote:Is GPU scaling still expensive to use?

Nope, but rendering is. Anyway, canvas resizing will not help, you need another way, maybe shaders or effect, or maybe you can try to resize everything in your game to make it look as needed.

Ahh, is canvas resizing not the same as using a shader to accomplish it?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Mon Dec 26, 2016 10:37 pm

Zebbi wrote:Ahh, is canvas resizing not the same as using a shader to accomplish it?

Scirra Manual wrote:Set canvas size
If a fullscreen mode is in use, this effectively changes the size of the Window size project property, which adjusts the size of the viewport.

Set Canvas Size just changes the window size property which adjusts the size of viewport, it doesn't stretch the game. As i understand, you want to stretch it
Zebbi wrote:doubling the resolution to x2 (or tripling to x3, quad with x3, etc) and resizing the height by 1.2 to create old-skool rectangular pixels? Like how they aspect correct in SCUMMVM by doing a scale and changing 320x200 to 320x240 after the scaling

You can't stretch the game from 320x200 to 320x240, you can only change the viewport with Set Canvas Size action.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Tue Dec 27, 2016 8:59 pm

Sisyphus wrote:
Zebbi wrote:Ahh, is canvas resizing not the same as using a shader to accomplish it?

Scirra Manual wrote:Set canvas size
If a fullscreen mode is in use, this effectively changes the size of the Window size project property, which adjusts the size of the viewport.

Set Canvas Size just changes the window size property which adjusts the size of viewport, it doesn't stretch the game. As i understand, you want to stretch it
Zebbi wrote:doubling the resolution to x2 (or tripling to x3, quad with x3, etc) and resizing the height by 1.2 to create old-skool rectangular pixels? Like how they aspect correct in SCUMMVM by doing a scale and changing 320x200 to 320x240 after the scaling

You can't stretch the game from 320x200 to 320x240, you can only change the viewport with Set Canvas Size action.

Here's a quote from scummvm:
Most games supported by ScummVM were designed to be played at a screen resolution of 320x200 using rectangular pixels (higher than they were wide). Most modern systems however are using square pixels, which means that the image appears to be squeezed vertically and the characters look wider and shorter than they should. If this option is checked, ScummVM corrects for this by stretching the game window to a resolution of 320x240 which with square pixels looks the same as 320x200 on old monitors. As with Graphic filters, this takes a little processing power to achieve. We can combine this with a Graphic filter, and for example with a scaling of x2 the window size will be 640x480 instead of 640x400.

I'm trying to work out if canvas size should be set at all? What shader would be best for upscaling in C2? I thik the @somebody scale shader would be fine to stretch, but the game first needs upscaling evenly by x2 or x3, etc.
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Wed Dec 28, 2016 12:39 pm

Zebbi wrote:I'm trying to work out if canvas size should be set at all? What shader would be best for upscaling in C2? I thik the @somebody scale shader would be fine to stretch, but the game first needs upscaling evenly by x2 or x3, etc.

I don't use shaders, so can't advice anything, however something like "On Start of layout -> Set Canvas Size (OriginalWindowWidth*2 x OriginalWindowHeight*2) & Set Layout Scale to 2 & Set Fullscreen Scalling to Low Quality" + Point sampling + Pixel Rounding: On + Scale shader may work... If it's not, then Set Canvas Size is not what you need.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests