• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Blood gui.

J

joqlepecheur

Guest
Sure, but why the GUI ?
  • it's in the foreground
  • it doesn't scale like the rest
Please try to explain a bit more :)
 

NicoFIDI

Member
make a sprite as big as the view and use this code.

on create write
Code:
/// Initilize values
the_alpha = 0;
on your beloved gui draw use:
Code:
/// Draw bloody image
var gui_scale = display_get_gui_width() / view_wview;
draw_sprite_ext(spr_blood, -1, 0,0,gui_scale, gui_scale, 0, c_white, the_alpha)
then you just change the_alpha (range[0,1]) to make it more or less visible.

WARNING: You can't (by definition), make a background on the gui,
unless your whole game it's on gui, witch it's wrong in so many levels that if it's the case, you should be executed
 
Last edited:
[UOTE="NicoFIDI, post: 158953, member: 15747"]make a sprite as big as the view and use this code.

on create write
Code:
/// Initilize values
the_alpha = 0;
on your beloved gui draw use:
Code:
/// Draw bloody image
var gui_scale = display_get_gui_width() / view_wview;
draw_sprite_ext(spr_blood, -1, 0,0,gui_scale, gui_scale, 0, c_white, the_alpha)
then you just change the_alpha to make it more or less visible.[/QUOTE]

Sorry if I didn't explain good enough. joqlepecheur was right I didn't explain good enough. what I meant was.

when another variable number increases for example: kill. then the alpha increases. sorry if I come off as rude! :( :(
 

NicoFIDI

Member
Sorry if I didn't explain good enough. joqlepecheur was right I didn't explain good enough. what I meant was.

when another variable number increases for example: kill. then the alpha increases. sorry if I come off as rude! :( :(
on the create
Code:
/// Initilize values
max_kills = 32;
actual_kills = 0;
On the draw gui
Code:
/// Draw bloody image
var gui_scale = display_get_gui_width() / view_wview;
draw_sprite_ext(spr_blood, -1, 0,0,gui_scale, gui_scale, 0, c_white, actual_kills/max_kills)
there, when actual kills reach max kills the image wont be transparent
 
on the create
Code:
/// Initilize values
max_kills = 32;
actual_kills = 0;
On the draw gui
Code:
/// Draw bloody image
var gui_scale = display_get_gui_width() / view_wview;
draw_sprite_ext(spr_blood, -1, 0,0,gui_scale, gui_scale, 0, c_white, actual_kills/max_kills)
there, when actual kills reach max kills the image wont be transparent
THANK YOU! :D
 
Top