draw_text(0,0,"Nukes: "+string(bomb_amount)) draw_set_color(c_white) draw_set_font(my_font)The code works but it makes my object invisible so i need help.
Posted 03 March 2012 - 09:19 PM
Posted 03 March 2012 - 09:21 PM
draw_sprite(spritename,spritename,x,y)replacing spritename with your sprites designated name.
Posted 03 March 2012 - 09:29 PM
Edited by greep, 03 March 2012 - 09:29 PM.
Posted 03 March 2012 - 09:33 PM
thanks it worked
also adddraw_sprite(spritename,spritename,x,y)replacing spritename with your sprites designated name.
Posted 03 March 2012 - 09:45 PM
Posted 03 March 2012 - 09:51 PM
GameMaker default draws the sprite that the object has WHEN THE DRAW EVENT HAS NO CODE. This means that you can apply any transforms (image_xscale, image_alpha etc...) in other steps and they will show. However, the moment you add code to the draw event you are basically saying "hey, GM! I´m in charge and I´ll tell you what to draw!". So, GM only draws what you tell it to, in this case the text. So, to tell it to draw the sprite of the object too, you need to use either :
draw_self() : This is the same as default drawing
draw_sprite() : This will draw the sprite but NO transforms
draw_sprite_ext() : This will draw the sprite and any transforms depending on what values you use for it.
Hope that clears up any confusion!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users