Skip to content

Latest commit

 

History

History
93 lines (72 loc) · 3.86 KB

README.md

File metadata and controls

93 lines (72 loc) · 3.86 KB


HOLEMAP

A library for Gamemaker v2.3+ to easily turn one or more tile layers into surfaces


WHAT IS HOLEMAP

Holemap is a small library made for Gamemaker v2.3+, this library gives you functions to easily take tile layers present in a room and pack them in a buffer that can then be turned into a surface, drawn and manipulated, from simple stretching to shader effects.

These buffers, called "Holemaps", are saved in a global map when they're created and can easily be accessed by other objects. Holemaps are saved as lightweight buffers and you can create as many as you want, using any order of layers you want (as long as the layers are in the room itself of course).


SETTING UP

Setting up Holemap is super easy, simply download the yymps , open your project, drag the yymps into Gamemaker and import everything, and you're done! Holemap automatically initialises itself right before the game starts.


But of course, we aren't done yet, what about creating and using these "Holemaps"?
To create a Holemap, you need to use the Holemap() function and assign it to a variable

myHolemap = Holemap(layer name,Holemap name);

Both arguments have to be strings, you can use an array of layer names to pack multiple tile layers at once, the order at which they're packed is the same as the order set in the array.

Now we have the Holemap ready and saved, the myHolemap variable contains a struct which contains the buffer itself (in the "buffer" variable)
Take that buffer and turn it into a surface using the Holemap_surface() function

mySurface = Holemap_surface(myHolemap);

Tip: while all this code is supposed to be in an object's Create event, it's always good to check if the surface exists and recreate it if it doesn't exist anymore.
And now you're done! You can use the mySurface variable just like any regular surface and apply all sorts of effect to it, make sure to check the release to see how to apply some basic effects to your Holemaps.

Remember to free the Holemap and the surface once they aren't needed anymore

Holemap_surface_free(mySurface);
Holemap_free(Holemap name);

EXAMPLE

The release and the project file in the repository contain a small example that showcases 5 different ways Holemaps can be used, these include:

  • Drawing multiple copies of a Holemap
  • Applying basic scaling, rotation, color adjustment, and alpha fading of a Holemap (shown in the gif below)
  • Applying blend modes to a Holemap
  • Applying a shader to a Holemap
  • Clipping graphics to a Holemap


ABOUT AND CREDITS

Holemap is licensed under the MIT license

Holemap made by Electro
Thanks to Sqirra for coming up with the name
Originally made for Gate