Upvote Upvoted 1 Downvote Downvoted
Hud creation help.
posted in Customization
1
#1
0 Frags +

I'm making my first hud from scratch, and I've got these team coloured bars:

http://i.imgur.com/wZPQtVH.jpg

I want to change their opacity, but I'm not sure how. Here's the code for the health's bar:

"TeamIndicatorLeft"
{
"ControlName" "CTFImagePanel"
"fieldName" "TeamIndicatorLeft"
"xpos" "100"//0
"ypos" "350"
"zpos" "-100"
"wide" "250"//350
"tall" "60"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"image" "../hud/color_panel_brown"
"scaleImage" "1"
"teambg_1" "../hud/color_panel_brown"
"teambg_2" "../hud/color_panel_red"
"teambg_3" "../hud/color_panel_blu"

"src_corner_height" "40" // pixels inside the image
"src_corner_width" "40"
"draw_corner_width" "0" // screen size of the corners ( and sides ), proportional
"draw_corner_height" "0"
}
I'm making my first hud from scratch, and I've got these team coloured bars:
[img]http://i.imgur.com/wZPQtVH.jpg[/img]

I want to change their opacity, but I'm not sure how. Here's the code for the health's bar:

[quote] "TeamIndicatorLeft"
{
"ControlName" "CTFImagePanel"
"fieldName" "TeamIndicatorLeft"
"xpos" "100"//0
"ypos" "350"
"zpos" "-100"
"wide" "250"//350
"tall" "60"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"image" "../hud/color_panel_brown"
"scaleImage" "1"
"teambg_1" "../hud/color_panel_brown"
"teambg_2" "../hud/color_panel_red"
"teambg_3" "../hud/color_panel_blu"

"src_corner_height" "40" // pixels inside the image
"src_corner_width" "40"
"draw_corner_width" "0" // screen size of the corners ( and sides ), proportional
"draw_corner_height" "0"
} [/quote]
2
#2
0 Frags +

from my understanding, the thing you're trying to edit is an image panel that pulls from TF2's default image files to make that color.

try making your own red box that isn't an image panel so you can control it's RGBA values.

(I'm not 100% certain because I haven't messed with image panels so maybe wait for someone smarter to help you)

edit: thanks hanbrolo, I knew it wasn't as simple as this

from my understanding, the thing you're trying to edit is an image panel that pulls from TF2's default image files to make that color.

try making your own red box that isn't an image panel so you can control it's RGBA values.

(I'm not 100% certain because I haven't messed with image panels so maybe wait for someone smarter to help you)

edit: thanks hanbrolo, I knew it wasn't as simple as this
3
#3
4 Frags +

the above won't work if you want it to change color depending on which team you're on. that would just be a permanent red box. if you want it to be team-colored you're going to need to edit the image files.

  • you're gonna want to get photoshop or gimp (the latter is free and, while worse than photoshop, will work fine for something as simple as this) and create your own rectangular images, one blue and one red, and edit their opacity.
  • then either get vtfedit or the photoshop/gimp vtf plugins and convert your image to a .vtf. then write an accompanying .vmt file and place both in vgui/replay/thumbnails. more details on vtf/vmt can be found in my hud crosshairs guide here (ctrl+f for 'creating your own crosshair' for the relevant section).
  • then when it says 'teambg2' replace it with "replay/thumbnails/ *title of your red image* ", the same for blue.

pat yourself on the back, you've just created and implemented your very own custom texture.

the above won't work if you want it to change color depending on which team you're on. that would just be a permanent red box. if you want it to be team-colored you're going to need to edit the image files.

[list]
[*] you're gonna want to get photoshop or gimp (the latter is free and, while worse than photoshop, will work fine for something as simple as this) and create your own rectangular images, one blue and one red, and edit their opacity.
[*] then either get vtfedit or the photoshop/gimp vtf plugins and convert your image to a .vtf. then write an accompanying .vmt file and place both in vgui/replay/thumbnails. more details on vtf/vmt can be found in my hud crosshairs guide [url=https://docs.google.com/document/d/1cpANKL3GRq7IcS3TzH2zD_59ydkU2QWNOuegmyzMxZU/edit]here[/url] (ctrl+f for 'creating your own crosshair' for the relevant section).
[*] then when it says 'teambg2' replace it with "replay/thumbnails/ *title of your red image* ", the same for blue.
[/list]

pat yourself on the back, you've just created and implemented your very own custom texture.
4
#4
1 Frags +

add alpha "#" to the end where # is replaced by opacity

add alpha "#" to the end where # is replaced by opacity
5
#5
2 Frags +

^ wouldn't work unfortunately. that only works for an image panel that is an actual block of color; you can't use it for an imagepanel that references a .vtf file unfortunately.

again: if you want your background to change color depending on the team I'm pretty sure my method is the only way.

^ wouldn't work unfortunately. that only works for an image panel that is an actual block of color; you can't use it for an imagepanel that references a .vtf file unfortunately.

again: if you want your background to change color depending on the team I'm pretty sure my method is the only way.
6
#6
2 Frags +

Thanks han, it works!

Thanks han, it works!
Please sign in through STEAM to post a comment.