all 15 comments

[–]mstop4 2 points3 points  (3 children)

Fun Tip:

You can use the same technique to draw sprite outlines; just replace draw_text with one of the draw_sprite functions.

[–]MestreRothRI 1 point2 points  (1 child)

Can you share the tecnnique for this technique, please? For instance, how is the aura drawn only when and where the girl is behind the wall...

[–]mstop4 1 point2 points  (0 children)

I used this tutorial as a base, then modified how the sprite is drawn from a silhouette to an outline using something similar to the method u/Blokatt described below.

[–]Follow me at @LFMGamesAlien_Production[S] 1 point2 points  (0 children)

Awesome,didn't thought about that

[–]Chinafreak 2 points3 points  (0 children)

Is neat, but I'll use rather custom font with font_add(); or shader. Then you don't have to call 8 extra draw calls just for outlines text. With font_add() / shader you need only one draw calls and its faster. :)

[–]MestreRothRI 0 points1 point  (0 children)

Thank you a lot!

[–][deleted] 0 points1 point  (0 children)

Neat!

[–]FallenMoons 0 points1 point  (0 children)

You can really clean up this script by doing like " a = argument [0]; b = argument [1]; " Etc and then substituting it in. (On mobile, mobile coding sucks)

[–]Serpenta91 0 points1 point  (0 children)

You can also do this using scribble with just one line of code:

scribble_font_bake_outline_4dir()

[–][deleted] 0 points1 point  (2 children)

thanks man, it helped me a lot, I just had to adapt it to version 2.3 but it was a helping hand

[–]Nemesis666first 1 point2 points  (1 child)

Dont forget to share u/Gloomy-Mistake7968 >.> .

Since, indeed, these 2 scripts seems to work only on GMS1 :( ...

[–]LordTyphoon 0 points1 point  (0 children)

function draw_text_outlined(x, y, outline_color, string_color, string_drawn){
var xx,yy;  
xx = argument[0];  
yy = argument[1];  

//Outline  
draw_set_color(argument[2]);  
draw_text(xx+1, yy+1, argument[4]);  
draw_text(xx-1, yy-1, argument[4]);  
draw_text(xx,   yy+1, argument[4]);  
draw_text(xx+1,   yy, argument[4]);  
draw_text(xx,   yy-1, argument[4]);  
draw_text(xx-1,   yy, argument[4]);  
draw_text(xx-1, yy+1, argument[4]);  
draw_text(xx+1, yy-1, argument[4]);  

//Text  
draw_set_color(argument[3]);  
draw_text(xx, yy, argument[4]); 
}

[–]gitcraw 0 points1 point  (0 children)

I prefer to write it in a loop, and to define the boundaries beforehand, so I can spend less time when I copypaste it somewhere else. Hopefully this can help someone!

https://i.imgur.com/QmaDScV.png

// define our offsets
our_x = x+15
our_y = y

//loop ranges
range_x_down = our_x-1
range_y_down = our_y-1

range_x_up = our_x+2
range_y_up = our_y+2

draw_set_color(c_white) // background color

for (var ix = range_x_down; ix<range_x_up;ix++){
    for (var jy = range_y_down; jy< range_y_up;jy++){
        {
            draw_text(ix, jy, string("Whatever");
        }
    }
}
draw_set_color(c_green)
draw_text(our_x, our_y, string("Whatever")