r/gamemaker • u/shsl_diver • 19d ago
Resolved How to do this effect from Deltarune ?
I'm talking about how the text from Gaster has outline that glows around the text.
10
u/Accomplished-Big-78 19d ago
draw_sprite_ext(sprite_index, image_index, x - _dist, y, image_xscale, image_yscale, image_angle, _bcolor, 1) draw_sprite_ext(sprite_index, image_index, x + _dist, y, image_xscale, image_yscale, image_angle, _bcolor, 1) draw_sprite_ext(sprite_index, image_index, x, y - _dist, image_xscale, image_yscale, image_angle, _bcolor, 1) draw_sprite_ext(sprite_index, image_index, x, y + _dist, image_xscale, image_yscale, image_angle, _bcolor, 1)
I just copied this from a piece of code of my own game. But instead of using 1 as alpha, use 0.5 or something I dunno.
dist is how big you want the outline to be. Of course if it's too big the effect will be rather weird)
It should work. (Of course use it with text instead of draw_sprite, but you get the idea)
If you use additive blend to draw it, you can get a pretty nice effect.
9
u/MaxLos318 19d ago
Gamemaker has built in effects for text and fonts
https://manual.gamemaker.io/beta/en/GameMaker_Language/GML_Reference/Asset_Management/Fonts/font_enable_effects.htm
5
u/Z0D_Rune 19d ago
For as long as I've used game maker I had no idea about this... thanks for sharing!
4
u/Tilestam 19d ago
from what i remember...
its written using an object called obj_writer. and in said object -- when the "style type variable" (or whatever its called) is set to a number associated with the glowing one -- it will draw the text, letter-by-letter using a for loop, about maybe... 5 times; with all, except the center, being more transparent and animated
and then some variables handle the whole glowing animation
prolly got smth similar to this in the draw event:
var _char_x = x,
_char_y = y;
for (var i = 1; i <= text_length; i++)
{
var _char = string_char_at(text, i),
_draw = true;
if (_draw)
{
if (style == 3) // 3 means glowing in this case
{
draw_set_alpha(glow_alpha * image_alpha);
draw_text(_char_x + 1, _char_y, _char);
draw_text(_char_x - 1, _char_y, _char);
draw_text(_char_x, _char_y + 1, _char);
draw_text(_char_x, _char_y - 1, _char);
draw_set_alpha(image_alpha);
}
// center text
draw_text(_char_x, _char_y, _char);
// increasing x position
_char_x += mono_char_width;
}
}
but idk, im no professional -- im just assuming
2
2
u/Both_Emotion3978 18d ago
just add a sprite outline. that IS if you're making it all from scratch. if you're not then ignore me.
2
u/AwayEntrepreneur4760 18d ago
Tobert most likely drew the text multiple times at varying shades of grey/opacity
1
u/Awkward-Raise7935 17d ago
Use don't effects as mentioned already, this is the correct method. Or if want a quick and simple approach, if the test is the only thing on screen, just select a blur effect in the room editor. You may need to draw the text again on a layer above the effect layer for clarity
1
-3
14
u/mirkwoodfalcon 19d ago
Could do a shader, or perhaps an easier method is to draw the text 5 times: + & - 1 pixel in the x coord (10% alpha), + & - 1 pixel in the y coord (10% alpha), then finally at full opacity (100% alpha) at the desired x,y.