Thank GOD this video exists, I'm using this pallete swap tool that doesn't explain itself very well in its documentation, and now I know why-- if I have a draw step, I have to tell the game to draw the sprite myself!
hmm, I'm still not very clear why a Draw GUI event exists. Couldn't we draw a text by using the normal Draw event? I saw some tutorials where it was used a Draw event to draw text on a menu button and this kinda made me confused because I'm not sure why then there is a Draw GUI...
Draw GUI draws relative to the window of the game, the portion the player sees when they’re playing. The default draw event draws in relation to the game world itself. It’s much easier to draw a players health in one specific spot always, instead of having to get the camera location x and y, account for different room sizes, etc.. it’s possible to just use draw instead of GUI, but GUI is there to make your life easier overall.
thanks for your reply! So for example, if I want to make a health bar that follows a character in the game world (such as in a strategy game in the style of Age of Empires when there is a health bar on top of a villager or soldier unit) then in that case I should use the standard Draw event right? @@LetsLearnThisTogether
Ive made an obj_avatar for my obj_player and in there i have code logic which should work, but i dont know how to place this obj_avatar so it stays top left in all rooms!?
Just like the step event, you can choose to draw at a specific time. The main draw event is squished in the middle, and usually works great for anything you need to do. The begin and end give you more freedom about when to draw things, and will get run before and after the main draw event, respectively. If you needed to draw one sprite on top of another, you could put the latter sprite in the draw end event, and it would draw over the other one. Although I usually draw the sprites in the order I desire, so I haven't used draw begin or end very much myself.
I was wondering how I could use the draw_self() like the draw_sprite(), in the draw_sprite() you can draw a sprite on your player, for example, draw_sprite(spr_gun, 0, x, y), I want to know how I could use this by using the draw_self() instead of the draw_sprite(), thank you!
I'm trying to do something like draw_self(obj_player, 0, x, y), but that keeps coming up as an error, basiclly I'm trying to draw an object on another object but with the draw_self() instead of draw_sprite().
You can't repurpose draw_self. You'll need to still use draw_sprite, but you can do it from another object with a lower or higher depth, to make it appear above or below the character.
what if I'm on my obj_weapon draw event and I want to draw the weapon on my player, how would I use the draw_sprite() to draw the weapon on my player, I also want the weapon to follow the player, thanks!
The way I'd do it, is draw_sprite(mySprite, 0, playerX, playerY) And you'd make mySprite the sprite of that specific weapon. You may also be able to replace that with something like sprite_index if you're actually in that weapon object and you've assigned it the sprite. As far as I know, you'll need to manually handle how to draw it and where. Although this is something I'm working on in my own game, so stay tuned and I may find a more elegant solution.
Im not interested in signing up for a reoccurring monthly payment but would love to send you a one time payment as your videos are by far my favorite to learn GMS through youtube, let me know how to send you some money to thank you for the free lessons i got!
I very much appreciate the offer. Honestly the best way to do that would be to purchase one of my courses through the links below. I get 97% of the money spent that way, and you also get more content from me :)
Thank GOD this video exists, I'm using this pallete swap tool that doesn't explain itself very well in its documentation, and now I know why-- if I have a draw step, I have to tell the game to draw the sprite myself!
Late to the party, but am a GMS newbie, and found this very helpful.
You are good at explaining stuff. Thanks for speaking clearly.
Dear god why haven't I seen this channel sooner..
Hello and thank you for this. Great explanation on draw :)
Always the best, thank you :)
4:27 I wish you had explained this about draw_self in your Advanced Collisions Tutorial
+Pew Pew Dave I'm glad you figured it out though.
thank you you help me VERY much
Thanks for the tutorials
how to make the text based on a var
thank you for gamemaker video
great video
very helpful.
hmm, I'm still not very clear why a Draw GUI event exists. Couldn't we draw a text by using the normal Draw event? I saw some tutorials where it was used a Draw event to draw text on a menu button and this kinda made me confused because I'm not sure why then there is a Draw GUI...
Draw GUI draws relative to the window of the game, the portion the player sees when they’re playing. The default draw event draws in relation to the game world itself. It’s much easier to draw a players health in one specific spot always, instead of having to get the camera location x and y, account for different room sizes, etc.. it’s possible to just use draw instead of GUI, but GUI is there to make your life easier overall.
thanks for your reply! So for example, if I want to make a health bar that follows a character in the game world (such as in a strategy game in the style of Age of Empires when there is a health bar on top of a villager or soldier unit) then in that case I should use the standard Draw event right? @@LetsLearnThisTogether
@scaredylamb indeed!
It doesn't scale with the camera/view
Ive made an obj_avatar for my obj_player and in there i have code logic which should work, but i dont know how to place this obj_avatar so it stays top left in all rooms!?
You have to adjust for the cameras moving, if you’re using one. If not then just put it there and it will stay unless you move it.
whats the draw begin or the draw end?
Just like the step event, you can choose to draw at a specific time. The main draw event is squished in the middle, and usually works great for anything you need to do.
The begin and end give you more freedom about when to draw things, and will get run before and after the main draw event, respectively. If you needed to draw one sprite on top of another, you could put the latter sprite in the draw end event, and it would draw over the other one. Although I usually draw the sprites in the order I desire, so I haven't used draw begin or end very much myself.
I was wondering how I could use the draw_self() like the draw_sprite(), in the draw_sprite() you can draw a sprite on your player, for example, draw_sprite(spr_gun, 0, x, y), I want to know how I could use this by using the draw_self() instead of the draw_sprite(), thank you!
Hmm, I'm a little confused. Can you give me the specific example you're trying to do?
I'm trying to do something like draw_self(obj_player, 0, x, y), but that keeps coming up as an error, basiclly I'm trying to draw an object on another object but with the draw_self() instead of draw_sprite().
You can't repurpose draw_self. You'll need to still use draw_sprite, but you can do it from another object with a lower or higher depth, to make it appear above or below the character.
what if I'm on my obj_weapon draw event and I want to draw the weapon on my player, how would I use the draw_sprite() to draw the weapon on my player, I also want the weapon to follow the player, thanks!
The way I'd do it, is draw_sprite(mySprite, 0, playerX, playerY)
And you'd make mySprite the sprite of that specific weapon. You may also be able to replace that with something like sprite_index if you're actually in that weapon object and you've assigned it the sprite.
As far as I know, you'll need to manually handle how to draw it and where. Although this is something I'm working on in my own game, so stay tuned and I may find a more elegant solution.
Link to sprite RedTree?
Thanks for noticing that! It's easy to forget those things sometimes.
Halo everybody
Im not interested in signing up for a reoccurring monthly payment but would love to send you a one time payment as your videos are by far my favorite to learn GMS through youtube, let me know how to send you some money to thank you for the free lessons i got!
I very much appreciate the offer. Honestly the best way to do that would be to purchase one of my courses through the links below. I get 97% of the money spent that way, and you also get more content from me :)
this video is great and helped me learn a lot, but i can't stand the way you say gui
One day you’ll come around to the dark side