ownerdraw



ownerdraw is the command that displays info on the screen.
For example: the weapon icon and ammo value


menuDef {
name "Ammo"
visible 1
rect 266 442 99 36

itemDef {
name "weapon icon"
rect 12 0 24 24
visible 1
ownerdraw CG_PLAYER_AMMO_ICON2D
}

itemDef {
name "ammo number value"
rect 39 10 63 12
visible 1
textstyle ITEM_TEXTSTYLE_SHADOWED
textscale .62
forecolor 1 1 0 .5
ownerdraw CG_PLAYER_AMMO_VALUE
addColorRange -999 5 1 0 0 1
}
}

Note: for text items you can define
texstyle
textscale (size)
forecolor

To display your own text use this command
text "your_text_here"



This is a list of the possible values for ownerdraw
(almost complete)
(alignment is relative to the area defined by itemDef)

CG_PLAYER_HEALTH
alignment: bottom center

CG_PLAYER_ARMOR_VALUE
alignment: bottom center

CG_PLAYER_AMMO_VALUE
alignment: bottom center

CG_PLAYER_ARMOR_ICON
CG_PLAYER_AMMO_ICON
CG_PLAYER_ARMOR_ICON2D
CG_PLAYER_AMMO_ICON2D

CG_PLAYER_HEALTH_BAR_100
CG_PLAYER_HEALTH_BAR_200
CG_PLAYER_ARMOR_BAR_100
CG_PLAYER_ARMOR_BAR_200
Bars consist of two items. One goes up to 100 and the other goes up to 200.
Each item requires a background image.
example:
menuDef {
name "Health Bars"
fullScreen MENU_FALSE
visible MENU_TRUE
rect 130 435 142 32

itemDef {
name "health Fill 200"
rect 85 0 64 32
visible 1
ownerdraw CG_PLAYER_HEALTH_BAR_200
style WINDOW_STYLE_FILLED
background "ui/assets/hud/h200.tga"
}

itemDef {
name "health Fill 100"
rect 0 27 128 16
visible 1
ownerdraw CG_PLAYER_HEALTH_BAR_100
style WINDOW_STYLE_FILLED
background "ui/assets/hud/h100.tga"
}
}


CG_GAME_TYPE_ICON
can't change the color.

CG_GAME_TYPE
name (example "Free For All")
alignment: on top - left

CG_CAPFRAGLIMIT
captures, frags or rounds limit.
alignment: on top - left

CG_LEVELTIMER
alignment: on top - left

CG_ROUNDTIMER
in CA, 30-second countdown to end of round
red text
alignment: on top-left

CG_1STPLACE
CG_2NDPLACE
numbers only
In team matches (CTF, CA, TDM)
CG_1STPLACE is red team
CG_2NDPLACE is blue team
In FFA these are the actual 1st place and 2nd place
alignment: on top - left

CG_1ST_PLACE_SCORE
CG_2ND_PLACE_SCORE
names and numbers
alignment: on top - center

CG_PLAYER_SCORE
individual score for team games
(it also shows your score in FFA)
alignment: bottom - center


CG_BLUE_SCORE
CG_RED_SCORE
numbers only
alignment: bottom - right

CG_MATCH_WINNER
"x wins with n"
alignment: on top - left

CG_PLAYER_HASFLAG
CG_PLAYER_HASFLAG2D
(icons) if you have the flag

CG_RED_CLAN_PLYRS
CG_BLUE_CLAN_PLYRS
for Clan Arena, number of survivors.
alignment: on top - left

CG_KILLER
who fragged you
alignment: bottom - center

CG_PLAYER_OBIT
constant update: who fragged who
can't change color.
alignment: on top - left

CG_MAP_NAME
alignment: on top - left

CG_PLAYER_LOCATION
works only for some maps.
alignment: bottom - left

CG_AREA_NEW_CHAT
area to show the chat messages.
can't change size or color.
alignment: bottom - left

CG_FOLLOW_PLAYER_NAME
"Following player_name - (Red/Blue)
alignment: on top - left

CG_PLAYER_HEAD
3D icon


CG_PLAYER_ITEM
Icon. Usable items: kamikaze, invulnerability, etc.

CG_CTF_POWERUP
Icon. Capture the Flag powerups: scout, guard, etc.

CG_AREA_POWERUP
Powerups: quad-damage, regeneration, etc.
take a look at the highlighted lines.
itemDef {
rect 0 0 35 35
visible 1
ownerdraw CG_AREA_POWERUP
special 4 // space between icons
align HUD_VERTICAL //or HUD_HORIZONTAL
}

CG_TEAM_COLOR
adds a color background.
red/blue for team games, no background for non-team games.

CG_TEAM_COLORIZED
requires a background image.
displays the image using red/blue for team games, yellow for non-team games.
example:
itemDef {
rect 0 0 32 32
visible 1
ownerdraw CG_TEAM_COLORIZED
style WINDOW_STYLE_FILLED
background "icons/icon_time.tga"
}

3 comments:

  1. CG_PLAYER_HEAD
    3D icon
    gives me 2d icon, used as thumbnail. is it somehow linked to draw3d 0 i got in cfg file?

    ReplyDelete
  2. yeah, its linked. sorry, could check it earflier.. :)

    ReplyDelete
  3. Um, I am able to see the head and still have simple items.

    ReplyDelete