Scale layout/canvas to suit any resolution

Show us your completed creations made in Construct 2

Post » Sun Mar 26, 2017 8:54 am

Hi guys,

I made a little test project to allow a canvas to actually resize to fit ANY screen resolution, on the fly. The red squares will find the corners of the canvas and move to them. I set them to move with lerp so you can see it in action. Notice the sqaures do not scale as the size of the layout/canvas is adjusted.

I did this, mainly to tackle problems I'm personally having with making projects that would suit any device (fullscreen) - while not forcing an aspect ratio or orientation.

I wanted to build something that would dynamically reposition itself on any device, any resolution, any aspect.

Key factors in this project are to set your scaling method to scale outer (I think scale inner works as well), and to set to unbounded scrolling. Every object is then placed using ViewportLeft,ViewportRight,ViewportBottom,ViewportTop (which you could simplify by tracking those with some global variables or something).

Again, I just made this to solve one of my own issues, but thought it may be useful for some other people to help with this annoying issue. You could also incorporate a scale modifier if you wanted to maintain a given scale for your objects.

LINK: https://www.dropbox.com/s/gg2lzx8np5u5lho/CANVAS_RESCALER.capx?dl=0

*EDIT*
Realised I had RexRandom plugin in the project for some reason. I was messing with some other stuff and forgot to remove it. Should be a lot more user-friendly now. Sorry about that!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Tue Mar 28, 2017 1:22 am

This is really useful for cross platforms, thank you very much for this!
B
7
S
2
Posts: 14
Reputation: 505

Post » Wed Mar 29, 2017 3:47 am

Hakeemsdk wrote:This is really useful for cross platforms, thank you very much for this!

No problem at all. I'm glad someone has found it useful! :D

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474


Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 3 guests