Caution
As time passes by, this shader has evolved greatly and many new features have been added. This repository here is no longer under maintenance, as the new powerful features require my raptor library to be part of the game. I tried to isolate this shader from raptor, but with no success. Too many dependencies make this shader a real power horse, but only together with raptor. You may use this shader in its current form (it's good and working fine, even in html5), but this version here will receive no new features anymore. Consider including raptor into your project and use the raptor-version of this shader, which is packaged into the raptor release.
This shader is based on a Version of @JujuAdams, credits to him for the basic implementation to draw a sprite outlined. He helped me in implementing varying outline strengths, and I took over from that point.
The shader now offers rich functionality and supports even drawing of rotating sprites, by using their bounding box to set up the surfaces needed to draw the correct outline and it also offers Alpha Fading
and Pulse animations
.
What is Alpha Fading and what is a Pulse Animation, you ask?? Well, pictures tell more than a thousand words:
No alpha fading | Active alpha fading |
---|---|
Pulse with strength | Pulse with color |
---|---|
Of course, those effects can be combined and you may create a strength + color
pulse!
With this shader you can create stunning outline effects when the mouse touches an object! Go, try it out!
The repository contains a small demo project with a single room and some objects that will react on mouse_over with various outlines. There are some key bindings to alter the outline, let objects rotate, so you can see the surfaces correctly measure the real bbox of the outlined sprite, even when rotating.
The demo room will print the available key bindings on the screen, so just start it up and experiment!
In the Releases section of the repository you can find a history of releases of this shader drawer.
The packge contains only the necessary files to be imported in your project.
When importing, a outline-shader-drawer
group is created in the root of your project. Move it to a location that fits your project best.
Find the documentation in the Wiki.
License: MIT (Contained in the repository)
Authors: Grisgram and Juju Adams
If you like what you see, ⭐ the repository and consider following me. The more reach the libraries get, the better they can evolve! Thank you!
Gris.
(c)2022- coldrock.games
In case you are a night owl like me and you want to support my work,
especially the gml-raptor platform for GameMaker,
spend me a coffee through PayPal.
Thank you!