GameMaker Studio 2 D&D blocks - Draw Value

Subscribers:
499
Published on ● Video Link: https://www.youtube.com/watch?v=re1FL8_xOMg



Duration: 10:02
223 views
5


In this video we are learning how and when to use Game Maker Studio 2 Drag and Drop Block which is called:
Draw Value

This block is part of the Drawing group of blocks.
It is in the first row, second from the left and it has big T letter on it as icon.
As always you just need to drag and drop it to start using it, but be carefull Drawing blocks must be used only in Draw Events !!!
Otherwise they will not show up text or number value on screen or some errors will be created in the game.
So, again, just watch out when you use Drawing D&D blocks and put them into Draw Events only.

When you do that, you will see that this block has couple of option fields:
Caption - the caption for the value, like title before the text or number, for example: Health, Ammo, Coins,...
Value - the value of the number or the text that you want to show on the screen (it can be dynamic, interactive, like variable, health points, coin number,...)
X - x coordinate of the text drawn on the screen
Y - y coordinate of the text drawn on the screen
For your game you can use only the fields which you need, not all, so if you don't need Caption just leave it empty "", same with Value field.
Also it is possible to use numbers in Caption, as text in Value, which I did not use in my example, but just to know if you need it, experiment a bit.

1:25 - some ideas on where to use this Draw Value D&D block
2:50 - adding the Draw Value block into Create Event (wrong way)
5:50 - adding the Draw Value block into Draw Event (right way)

This D&D block will work this way fine and it will draw some value on the screen.
But it is kinda tricky because we have made another problem with it.
Adding it on some kind of object with the Sprite, it will make that Object invisible on the screen, why ?
That's the way the GameMaker Studio 2 works, it's not the bug it's the feature !
But don't worry, we will solve that problem and explain it next video in more details.

Until then, keep on learning !!!