Giter VIP home page Giter VIP logo

gml-outline-shader-drawer's Introduction

3️⃣.2️⃣

Welcome to the outline-shader-drawer for GameMaker Studio 2.3+ repository!

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
image image
Pulse with strength Pulse with color
pulse-shader-strength pulse-shader-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!

How to use

First time users: Clone the repo and start the demo project

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!

Get the package

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-2023 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!

gml-outline-shader-drawer's People

Contributors

grisgram avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gml-outline-shader-drawer's Issues

shader_get_uniform called for every render step

shader_get_uniform needs to be called only once - this reference does not change.

Remove from the draw method and make the uniform handles instance variables on the outline_drawer struct class.

help please


############################################################################################
ERROR in
action number 1
of Draw Event
for object OutlineObjectBaked:

Canvas Error: Canvas has no data or in use!
at gml_Script___CanvasError (line 3) - show_error("Canvas Error: " + _str, true);
############################################################################################
gml_Script___CanvasError (line 3)
gml_Script_anon_Canvas_gml_GlobalScript_Canvas_25410_Canvas_gml_GlobalScript_Canvas (line 869) - __CanvasError("Canvas has no data or in use!");
gml_Script_anon_Canvas_gml_GlobalScript_Canvas_19934_Canvas_gml_GlobalScript_Canvas (line 701) - __validateContents();
gml_Script_anon_CanvasSprite_gml_GlobalScript_sprite_to_canvas_2324_CanvasSprite_gml_GlobalScript_sprite_to_canvas (line 59) - canvas.DrawPart(subimages[@ frame], 0, image_width, image_height, xp - xoffset, yp - yoffset);
gml_Script_anon_gml_Object_OutlineObjectBaked_Create_0_1485_gml_Object_OutlineObjectBaked_Create_0 (line 46) - canvas.draw_frame(image_index, x - outline_strength - TEXTURE_PAGE_BORDER_SIZE, y - outline_strength - TEXTURE_PAGE_BORDER_SIZE);
gml_Object_OutlineObjectBaked_Draw_0 (line 4) - self.__draw();
gml_Object_obj_shootable_Draw_0 (line 6)

things run fine in demo project but i have no idea why it crashes when i import it to mine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.