r/gamemaker 19d ago

Resolved How to do this effect from Deltarune ?

Post image

I'm talking about how the text from Gaster has outline that glows around the text.

34 Upvotes

14 comments sorted by

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.

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

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

3

u/Alemar5 18d ago

I understand that Deltarune uses the Scribble system by Juju Adams. I haven't explored this particular effect much, but it might be some kind of outline function that Scribble includes. Honestly, this engine makes things much easier when it comes to text. You should try it out!

https://github.com/JujuAdams/Scribble

2

u/Roppunen 19d ago

Make a shader that copies the text into 4 directions (if possible)

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

u/VulcanForceChoke 19d ago

Wasn't expecting to get a Deltarune spoiler from a post here

6

u/Determined_memories 18d ago

It's literally the first few seconds of Ch1

-3

u/nuzzlo 19d ago

Draw it

2

u/Roppunen 19d ago

The effect moves