GameMaker: Automatic pixel-perfect window scaling


Comparison

This isn't an exactly recent example, but since my previous website is gone for good, there wouldn't be a good way to find it somewhere now.
So here you go, system to make game scale to different view size perfectly.
Initial problem occurs to tiles (and theoretically any graphics drawn partially), due to single-pixel 'leaks' of surrounding pixel data when drawing scaled images. That persists only on some computers, making it fairly confusing.
Installation is as simple as moving two related objects over, setting a variable value (global.pscale), and creating a instance of obj_pscale where pixel-perfect scaling is needed.
Generally it's quite simpler than editing all your tilesets, though that probably works better for some situations still.

Download GMK

GameMaker: Taking screenshot of area larger than screen


Above: in-game view. Below: taken screenshot of entire room

This is an example that I've actually made a long time ago, but apparently it remains a common unresolved problem.
For multiple cases you may need to take a screenshot (or copy to surface) entire room, while only portion of it can be seen at once (window/screen size limitations).
A perfect work-around for this is to force screen drawing into a surface of chosen size, after adjusting view settings.

Download GMK

GameMaker: Surfaces and scrollable content

In some cases, a moment comes when you need to display specific content in a area smaller than itself, thus requiring scrolling.

GameMaker does not support 'clip rectangle' type of command for its reasons, however it is easy to 'clip' area to be drawn by using an 'buffer' surface to draw content in, before drawing that to screen.
Attached example illustrates sample implementation of such.

Most often, content of such would be text. And maybe an image. Or two.

Since images would require a bit more code, example does simple and efficient - long long text is rendered into a surface, which is later drawn into an other 'buffer' surface to display it as part of window on screen.
Also there is a scrollbar, which obviously can be improved, if it needs to serve purposes other than displaying position of 'window'.

Download