It doesnt have to do anything, just so he has a visual on screen
Cobra
Moderator: Moderators
Code: Select all
//------------------------------------------------->
// active scoreboard
//------------------------------------------------->
print_points:
while (1)
{
waitthread hudprint ("Countdown: " + (level.counter) + " seconds" + "\n" + "Missile health: " + (level.misslehealth) + " percent" ) .75 .65 .1 // three numbers are for color (gold)
}
waitframe
end
hudprint local.nstring local.r local.g local.b:
huddraw_rect 187 140 -84 50 50
huddraw_color 187 local.r local.g local.b
huddraw_font 187 "facfont-20"
huddraw_string 187 local.nstring
huddraw_align 187 left bottom
huddraw_alpha 187 1
wait .5 //refresh time
end

Code: Select all
menu "mystatbar" 128 136 NONE 0
bgcolor 0 0 0 0
align bottom centery
resource
Label
{
name "Default"
rect 16 24 32 96
rect 16 56 16 64
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
shader textures/hud/healthback
}
resource
Label
{
name "test bar"
rect 16 56 16 64
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
linkcvar "testbar"
statbar vertical 0 100 //statbar horizontal 0 100
statbar_shader textures/hud/healthmeter
statbar_shader_flash textures/hud/healthmeterflash
initdata 100
}
end
resource
Label
{
name "test number"
title "test"
//rect 56 82 64 16
rect 40 82 64 16
fgcolor 0.70 0.60 0.05 1.00
bgcolor 0.00 0.00 0.00 0.00
borderstyle "NONE"
textalign left
font facfont-20
}
resource
Label
{
name "healthnumber"
//rect 56 104 64 16
rect 40 104 64 16
fgcolor 0.70 0.60 0.05 1.00
bgcolor 0.00 0.00 0.00 0.00
borderstyle "NONE"
linkcvar "testbar"
textalign left
font facfont-20
}
Code: Select all
main:
showmenu mystatbar
level.testbar = 100
thread hudtest
end
hudtest:
while(level.testbar > 0)
{
setcvar testbar level.testbar
wait .25
level.testbar--
}
hidemenu mystatbar
end
Code: Select all
menu "mystatbar" 128 136 NONE 0
bgcolor 0 0 0 0
fgcolor 1 1 1 1
align right center
//==============================
// Backdrop
resource
Label
{
name "Default"
rect 16 56 16 64
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
shader textures/hud/healthback
}
//==============================
// Meter
resource
Label
{
name "test bar"
rect 16 56 16 64
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
linkcvar "testbar"
statbar vertical 0 20 //statbar horizontal 0 100
statbar_shader textures/hud/healthmeter
statbar_shader_flash textures/hud/healthmeterflash
initdata 20
}
//==============================
// Name
resource
Label
{
name "test number"
title "Fuel"
rect 40 82 64 16
fgcolor 0.70 0.60 0.05 1.00
bgcolor 0.00 0.00 0.00 0.00
borderstyle "NONE"
textalign left
font facfont-20
}
//==============================
// Number
resource
Label
{
name "testnumber"
rect 40 104 64 16
fgcolor 0.70 0.60 0.05 1.00
bgcolor 0.00 0.00 0.00 0.00
borderstyle "NONE"
linkcvar "testbar"
textalign left
font facfont-20
}
end.
Code: Select all
hudtest:
level.testbar = 20
wait 4
showmenu mystatbar
while(level.testbar > 0)
{
setcvar testbar level.testbar
wait 1
level.testbar--
}
hidemenu mystatbar
end