Jump to content


Photo

How to make a HuD


  • Please log in to reply
6 replies to this topic

#1 Thazzrill

Thazzrill

    GMC Member

  • New Member
  • 29 posts
  • Version:Unknown

Posted 03 July 2012 - 08:34 PM

Hello guys i have a problem. I am making a sidescrolling shooter. Basicly the screen size is 640x480. You can go down and up and the plane moves it self. Anyway i want to make a HUD to show score, health and lives. But i don`t know how to do it. I have a player object. Anyway can anyone explain me in detail and not over code cuz i ve seen tutorials and i got confused can anyone tell me how to do it with drag and drop? Thanks in advance!
  • 0

#2 FAAAEBS

FAAAEBS

    GMC Member

  • GMC Member
  • 157 posts
  • Version:GM8

Posted 03 July 2012 - 08:45 PM

There are drag and drop actions called draw lives, draw health bar, and draw score. Then you use those and indicate the x and y coordinates of the place you want each thing to be. Its that simple. If you are not using the default health and score, you use the draw variable action to make it draw the health and score variables.
  • 0

#3 Xbowman

Xbowman

    GMC Member

  • GMC Member
  • 45 posts
  • Version:GM8

Posted 03 July 2012 - 09:25 PM

Hello guys i have a problem. I am making a sidescrolling shooter. Basicly the screen size is 640x480. You can go down and up and the plane moves it self. Anyway i want to make a HUD to show score, health and lives. But i don`t know how to do it. I have a player object. Anyway can anyone explain me in detail and not over code cuz i ve seen tutorials and i got confused can anyone tell me how to do it with drag and drop? Thanks in advance!

that's right what he said but u have to add the actions in the draw event, also make sure u don't add the draw event in a object with a sprite, if u do that, the object won't be seen.
  • 1

#4 Thazzrill

Thazzrill

    GMC Member

  • New Member
  • 29 posts
  • Version:Unknown

Posted 03 July 2012 - 10:17 PM


Hello guys i have a problem. I am making a sidescrolling shooter. Basicly the screen size is 640x480. You can go down and up and the plane moves it self. Anyway i want to make a HUD to show score, health and lives. But i don`t know how to do it. I have a player object. Anyway can anyone explain me in detail and not over code cuz i ve seen tutorials and i got confused can anyone tell me how to do it with drag and drop? Thanks in advance!

that's right what he said but u have to add the actions in the draw event, also make sure u don't add the draw event in a object with a sprite, if u do that, the object won't be seen.

Yh i knew all that but how can i do it that is why i made the thread?
  • 0

#5 loverock125

loverock125

    GMC Member

  • GMC Member
  • 1606 posts
  • Version:GM8

Posted 04 July 2012 - 12:44 PM

Create a new object and call it oHUD. Inside this object's draw event, draw your HUD using the drag-n-drop draw functions (Found in the Draw tab). You can use sprites, lines, texts, shapes, backgrounds and so on. Make sure you place the object inside your room when you are done.

Also, you might want to decrease this object's depth since you want the HUD to appear on top of everything else.

Edited by loverock125, 04 July 2012 - 12:44 PM.

  • 0

#6 Terrified Virus

Terrified Virus

    Moderators Plaything

  • GMC Member
  • 721 posts
  • Version:GM:Studio

Posted 06 July 2012 - 04:53 PM

Guys, you can add a sprite in the draw event without having it not seen. You need to include the function draw_sprite_ext.
This code would make the sprite draw in its current state:

draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha)

  • 0

#7 bob_gmae

bob_gmae

    GMC Member

  • GMC Member
  • 22 posts
  • Version:GM8

Posted 14 August 2012 - 06:25 PM

i hope this works

/*
 the -32 is the length of the healthbar and the -2 is the heaight. 
the direction can be changed to any direction you want. its best to leave it as 
direction.the x_view and y_view is the view of the screen and will stay there no matter waht goes on 
*/
draw_healthbar(x_xview,y_yview,x_xview-32,y_yview-2,100,c_black,c_red,c_green,direction,1,1)

/* 
this code is to draw any image(sprite) on the screen at the second pixel to the right and buttom.
this can also be done with backgrounds.
*/
draw_sprite(sprite01,all,x_xview+2,y_yview+2)
draw_background(background01,x_xview+2,y_yview+2)

check out my game here
Posted Image

Posted Image

Posted Image
I'ts like EBAY... Only Free!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users