Hello everyone, in this GameMaker Studio 2 Tutorial video we learn how to draw text on the screen and issue damage pop-ups when you deal damage or take damage. In this tutorial we go over how to make a font, how to use image_alpha as a timer to determine how long the text lasts on the screen before we instance_destroy(); to remove the damage pop up. I’ll show you how to make the damage pop-up scroll in any direction after it’s created, how to change the font color to any color you want, and how to use the draw_text_ext(); function. We also review how to create objects on the map if you’ve missed some of the previous tutorials using instance_create_layer();. We also look at a new function called string(); which will turn any value given into a string value that can be drawn on the screen as text which can be further manipulated. This is a simple way of making damage pop-ups and drawing text on the screen in a dynamic way, but there are hundreds of ways to make this work. You can experiment and come up with an even better way to make it work in your game, but this method works perfectly fine. I hope you find this tutorial helpful, thanks for watching.

If you’ve enjoyed this video please consider giving it a Like, Favorite and share. You could always Subscribe to the channel if you haven’t already and as always, thanks for watching and we’ll see you in the next video! 🙂

DG Discord Server:

Website:

Twitch:

Twitter:

Patreon:

——————————-
Special thanks to all my Patrons:
Damian Floyd, Fun4theBrain, David Philips, Studio Blue, Battle Pisces Gaming, Michael Flynn, John Gibson, ChrAndGow, Scott Zarwell, Edwardo Santizo, NeoSoulGamer, Jai R Fisher, Rusty_Gears, Meteodros, R.A.M, Valryia, DarkKrow13, StalkerRoguen, Ervin Mcclure, Chris Van Essen, Mithrandir, Michael Noles and those of you who have supported me in the past.

Nguồn: https://shaarique.com/

Xem thêm bài viết khác: https://shaarique.com/game/

13 Comments

[-Kuzey Vural-]

July 7, 2020

Hey dude! How did you change the background?

Reply

Gregory Leon

July 7, 2020

in the Draw Event where you draw your sprite.
put
//Will set the draw alpha to the image_alpha
draw_set_alpha(image_alpha);
//Draw your damage
draw_text(x,y,"String");
//Sets alpha back to 100 Opacity.
draw_set_alpha(1);

It will now also fade out.

Reply

Jordan Rudolph

July 7, 2020

nice background

Reply

Alex McKnight

July 7, 2020

Fucking useless

Reply

Jacob Farny

July 7, 2020

Really simple and well explained solution. Thanks a bunch!

Reply

Kraig The Krevetka

July 7, 2020

Quick tip: first show how to create thing, then how to make it disappear. Time is money.

Reply

qqq ufo

July 7, 2020

4:08 / I recommend alarm set code on Create Section. not step. That's will saved 60 all frame.

Reply

KillerB Hive

July 7, 2020

clicks on video for info on the draw_text function
sees nekkid anime girl background
WOAH! Hey baby. 😉

Reply

fla gkdsa

July 7, 2020

u need to do for the alarm like this, surprised u didnt know:
if (alarm[0]=-1) //if alarm[0] is not set
{alarm[0]=60} //then set alarm[0] to 60 steps

Reply

Gangsta Pug

July 7, 2020

So in other words you have to create an object for every single source of damage that you have. Isn't that a little bit unreasonable? For example if you have 70 different damage sourses in the game you have to create 70 objects dedicated to showing each and every single tick of damage. Is there another way to make a universal damage ticker? Like a script or something?

Reply

Pierce Harris

July 7, 2020

I use GM studio, and im wondering what are the biggest changes to studio 2? Whats with the instance_create_layer function?

Reply

waynee95

July 7, 2020

The alarm didn't work because you set the alarm in the step event, so every step the alarm was set to 60. You had to put it in the create event of the dmg popup.

Why don't you use image_alpha -= 0.03 instead of image_alpha = image_alpha – 0.03? I think that's more readable.

Reply

Hunter Davis Films

July 7, 2020

will you play my game on first impressions i emailed you the demo

Reply

Leave a Reply