GMLsnip.com allows GameMaker developers to generate stylized GameMaker Language code snippets they can put on their own websites. To get started, simply write or paste GML code in the text boxes below. There's also some settings you can customize. Once you're happy with how your code looks, click the big blue "View the HTML/CSS" button to get your code. To see the snippets in the context of an actual blog post, check out my article, 20 GameMaker tips.
Copy the code below and paste it between your webpage's <head></head> tags. This code handles the styling for all of the GML snippets on a given page, so you only need it once per page.
Copy the code below and paste it where you desire between your webpage's <body></body> tags. This code will create the code snippet seen at the top of the webpage.
This section answers some questions you may have surrounding GMLsnip.com and the tools it offers.
My name is Zack Banack and I've been making games for over a decade. This tool was originally going to be exclusive to The Step Event, an educational GameMaker side project of mine. But, I quickly realized a lot of people could get use out of a utility like this.
I'm keeping GMLsnip free because I believe in free coding resources. My mission of The Step Event is to create the tutorials and resources I wish I had when I was new to game development. Plus, the GameMaker community is a small and tight-knit one.
If you want to support this project, you can disable ad blocking software for this page. If you're feeling highly generous, there's a link to buy me a cup of coffee at the bottom of the page. Donations are completely optional but highly appreciated!
GMLsnip needs JavaScript in order to make sense of the GML code you input. It runs a lexer, something that tokenizes (categorizes), strings of text. That's how this tool is able to distinguish variables from functions and numbers from strings. Fortunately, after the code snippet is generated, JavaScript is no longer needed.
There may be syntax edge-cases. Also, this utility is not a code validator nor a linter.
Because the snippets generated by GMLsnip do not require JavaScript, they cannot be pretty-printed on the fly. While this means they're viewable to a larger percentage of the internet, it comes at the expense of being more bloated. The elements in the HTML, CSS, and clipboard script are named the way they are as to have a slim-to-none chance of interferring with anything else on your website. Overkill? Probably.
While most modern JavaScript-enabled browsers should be able to copy the content via the clipboard button, some (notably, mobile) still fail. Luckily, the code can be manually highlighted and either right-click -> copy'd or ctrl/command + c'd.
I highly encourage you to keep the credits and link back to GMLsnip.com in the code that's generated on this website. If you must remove the credits, then please consider making a donation below as compensation.
No. This website is not — nor does it claim to be — affiliated with YoYo Games Ltd., GameMaker: Studio, GameMaker Studio 2, or any related products.
Yes! Once you copy and paste the code from this website onto yours, it's completely independent from GMLsnip.com.
You can do with this code as you please, bearing in mind the aforementioned attribution clause. But, if you edit the code, I won't be able to help you if something breaks.
For questions regarding affiliation, please contact me.
Want something colorful? Check out my color encyclopedia, 2020 Colors!