A brand new game
for Windows, Linux, Mac, HTML5, 3DS Homebrew and more
every week,
unless exhausted!
About Games Music Pixelart Poetry Home Patreon Scores JNKPlat Petit Switch
Blog
Scaling
  16th June, 2019
v0.0061 - Rewriting all the scaling, to allow for a virtual resolution.
Shoebox doesn't scale in a normal way.

-=-=-

Typically I'd say "Fit game into this screensize" and everything will scale to fit.
Images, Rectangles, Text, co-ordinates.. Everything would scale to fit the resolution requested.
Even returned co-ordinates, so that things like Mouse control works with the scaling.

I set a "virtual" resolution, code into that, and then the game runs at a scale that looks roughly equal to that.

But, Shoebox doesn't do that.
Instead, Shoebox gives me the screen width and height, and then I code each game to fit individually.

The GUI bar at the top is roughly the same size in pixels, no matter your resolution.
Text sizes are generally only scaled when things don't fit.
And although nearly all of the games DO end up scaling, I'm doing that per-game instead of having a "virtual screen" do the work.

For Browsercade, I'm going in the opposite direction.
This wasn't something I was aiming to do, but having tried to draw a simple starfield on the screen, I realise that scaling the sprites to suit the resolution is much preferable to .. not doing that!

So, tonight, I've spent a couple of hours working through all my drawing functions, and adding in scaling.
Due to this, the mouse/touch control is incredibly wonky, right now, but a few tweaks here and there should take care of that.

I need to rejig the default top-GUI bar, to include a proper Score/Highscore/Lives display, and then figure out a menu style that works.
I think I have an idea in mind, but am currently unsure how well it'll fit onscreen, and/or into the many files that I'm going to end up using to do it!!

Otherwise, things seem to be flowing fairly well.

I should *hopefully* have a proper test up and running in a day or two.

Views 29, Upvotes 2
Browsercade
Site credits : This was all done by Jayenkai
(c) Jayenkai 2017 and onwards. RSS feed
Blog - Scaling - AGameAWeek