Backgrounds



If you want to add a background color to the display areas add the following lines to the menuDef or itemDef sections

style WINDOW_STYLE_FILLED
backcolor 0 .85 .62 .5


The values of backcolor (left to right) mean

RED 0-1
GREEN 0-1
BLUE 0-1

TRANSPARENCY 0-1 (0 means invisible, 1 is solid color)
use values like 0.5 - 0.6 - 0.7, to get transparent backgrounds


If you want a gradient effect substitute

style WINDOW_STYLE_FILLED


with

style WINDOW_STYLE_GRADIENT



if you want to use an image as a background:

style WINDOW_STYLE_FILLED
backcolor .7 .7 .7 .7
background "icons/icon_time.tga"

The image will be displayed using the color indicated by backcolor
(you can't change the color of some images)

style WINDOW_STYLE_SHADER
background "icons/icon_time.tga"

The image will be displayed using its original colors.



Team color background

style WINDOW_STYLE_TEAMCOLOR

red and blue for team games
green for non-team games


or

style WINDOW_STYLE_TEAMCOLOR
ownerdraw CG_TEAM_COLOR

trasparent red and blue for team games
no background for non-team games



Background image that changes color depending on health, armor or ammo value
This example is a quake logo
menuDef {
visible 1
rect 305 400 30 30

itemDef {
visible 1
rect 0 0 30 30
style WINDOW_STYLE_FILLED
ownerdraw CG_PLAYER_HEALTH //you can change this for armor or ammo
background "textures/sfx/Blocks17final_pent.jpg"
addColorRange 151 200 0 1 0 .5
addColorRange 100 150 1 1 0 .5
addColorRange 51 99 1 .5 0 1
addColorRange 0 50 1 0 0 .5
}

}



background examples:

menuDef {
visible 1
rect 100 200 100 100

itemDef {
visible 1
rect 0 0 50 50
style WINDOW_STYLE_FILLED
backcolor 1 1 1 1
}

itemDef {
visible 1
rect 100 0 50 50
style WINDOW_STYLE_GRADIENT
backcolor 1 .5 .2 1
}

itemDef {
visible 1
rect 200 0 50 50
style WINDOW_STYLE_TEAMCOLOR
}

itemDef {
visible 1
rect 300 0 50 50
style WINDOW_STYLE_FILLED
background "textures/sfx/Blocks17final_pent.jpg"
backcolor 0 1 0 .01
}

itemDef {
visible 1
rect 400 0 50 50
style WINDOW_STYLE_SHADER
background "textures/sfx/Blocks17final_pent.jpg"
}

}


menuDef {
visible 1
rect 100 200 100 100

itemDef {
visible 1
rect 100 0 50 50
style WINDOW_STYLE_FILLED
ownerdraw CG_TEAM_COLOR
}

itemDef {
visible 1
rect 200 0 50 50
style WINDOW_STYLE_FILLED
background "textures/sfx/Blocks17final_pent.jpg"
ownerdraw CG_TEAM_COLORIZED
}

itemDef {
visible 1
rect 300 0 50 50
style WINDOW_STYLE_SHADER
background "textures/sfx/Blocks17final_pent.jpg"
ownerdraw CG_TEAM_COLORIZED
}

}

0 comments: