OpenBOR Wiki Graphics,OpenBOR Heads Up Display (HUD)

Heads Up Display (HUD)

Heads Up Display (HUD) post thumbnail image

Life Gauge Size​

lbarsize <w> <h> <noborder> <type> <orientation> <border> <shadow> <graph> <backfill>

#default
lbarsize 100 5 0 0 0 0 0 0 0

Controls size and layout of life gauges. Applies to players, enemies, items, etc.

  • w – Maximum width of the gauge.
  • h – Height of the gauge in pixels.
  • noborder – Disables the border and shadow around gauges.
  • type– How values are displayed.
    • 0 – Absolute. The gauge represents a pixel per unit value. For example, if the value is 50, the gauge fills to 50 pixels. If the value exceeds gauge’s capacity, the gauge will wrap around and ‘double up’ on top of itself as many times as necessary.
    • 1 – Ratio. The gauge represents a percentage of the value’s maximum. For example, if the value is 50 and its maximum is 100 (e.g. 50%) the gauge will fill exactly half way.
  • orientation– Direction of gauge fill.
    • 0 – Left (empty) to right (full).
    • 1 – Bottom (empty) to top (full).
  • border – Layer adjustment of outer border. Default to 0.
  • shadow – Layer adjustment of border shadow. Default to 0.
  • graph – Layer adjustment of graph fill. Default to 0.
  • backfill – Layer adjustment graph background. Default to 0.

Layer adjustments can place the gauge behind other elements. For instance, -300 is sufficient to place the gauge behind icons.

MP Gauge Size​

mpbarsize <w> <h> <noborder> <type> <orientation> <border> <shadow> <graph> <backfill>

Controls size and layout of MP gauges. Otherwise identical to Life Gauge Size.

Opponent Life Gauge Size​

olbarsize <w> <h> <noborder> <type> <orientation> <border> <shadow> <graph> <backfill>

If defined, overrides Life Gauge Size settings for last entity a player interacted with (hit, got hit by, etc.). Otherwise identical to Life Gauge Size.

Rush​

rush <config> <duration> <text1> <f1> <f2> <text2> <f3> <f4>

#default
rush 0 0 0 0 0 0 0 0

Display a consecutive hits counter on screen. Rush counter appears when player scores two or more combo hits. The counter will stay on screen and increment as long as the player accrues successful hits.

  • config– Basic setup for rush counter.
    • 0 = Disabled.
    • 1 = Enabled.
    • 2 = Enabled. Maximum hits always displayed.
  • duration -How long the counter will remains between hits.
  • text1 – Label text for the hits counter.
  • f1 – Font for text1.
  • f2 – Font for hits counter.
  • text2 – Label text for for maximum hits counter.
  • f3 – Font for text2.
  • f4 – Font for maximum hits counter.

Tip: Make sure to set location using Player Rush, or the rush counters will all be layered in the top left corner.

Score Format​

scoreformat <flag>

#default
scoreformat 0

Layout of player score.

  • 0 – Score aligns left. Unused digits are hidden.
  • 1 – Score aligns right. Unused digits are displayed.

Position​

General​

Timer​

timeloc <x> <y> <w> <h> <noborder>

#default
timeloc 149 4 21 20 0

Sets the position of the clock timer.

  • To change the font, you’ll need to work with the font file, not this command.
  • x – X Axis position of timer.
  • y – Y Axis position of timer.
  • w – Width of border box around timer.
  • h – Height of border box.
  • noborder – Disable border box.

Tip: The native timer is hard coded to use Font 3. Change the font file if you want the clock to have a unique font.

Background Icon​

bgicon <path> <x> <y>

#default
bgicon none 0 0

Adds a static always on background icon.

  • path – File path to icon image.
  • x – X Axis position of background icon.
  • y – Y Axis position.

Player​

Player Rush​

p#rush <x1> <y1> <x2> <y2> <x3> <y3> <x4> <y4>

#default
p#rush 0 0 0 0 0 0 0 0

Set position of player’s rush status. Requires active Rush.

  • # – Player number. Example: p1rush.
  • x1 – X Axis rush hits label text position.
  • y1 – Y Axis rush hits label text position.
  • x2 – X Axis rush hits counter position.
  • y2 – Y Axis rush hits counter position.
  • x3 – X Axis rush maximum hits label text position.
  • y3 – Y Axis rush maximum hits label text position.
  • x4 – X Axis rush maximum hits counter position.
  • x4 – Y Axis rush maximum hits counter position.

Player Icon​

p#icon <x> <y>

#default
p#icon 0 0

Player’s icon position.

  • # – Player number. Example: p1icon.
  • x – X axis position from left side of screen.
  • y – Y axis position from top of screen.

Player Icon (Weapon)​

Player icon when carrying a weapon.

  • # – Player number. Example: p1iconw.
  • x – X axis position from left side of screen.
  • y – Y axis position from top of screen.

Player Score​

p#score <name x> <name y> <dash x> <dash y> <score x> <score y> <font>

#default
p#score 0 0 0 0 0 0 0

Player’s name and score position.

  • # – Player number. Example: p1score
  • name x – X axis name position from left side of screen.
  • name y – Y axis name position from top of screen.
  • dash x – X axis “-” position from left side of screen.
  • dash y – Y axis “-” position from top of screen.
  • score x – X axis score position from left side of screen.
  • score y – Y axis score position from top of screen.
  • font – Font number of text.

Player Life​

p#lifex <x> <y> <font>

#default
p#lifex 0 0 0

Player’s life gauge position.

  • # – Player number. Example: p1life.
  • x – X axis position from left side of screen.
  • y – Y axis position from top of screen.

Player Life Count​

p#lifen <x> <y> <font>

#default
p#lifen 0 0 3

Player’s remaining life count.

  • # – Player number. Example: p1lifen
  • x – X axis position from left side of screen.
  • y – Y axis position from top of screen.
  • font – Font number of numeric.

Player Name (Join)​

p#namej <name x> <name y> <select x> <select y> <start x> <start y> <font>

#default
p#namej 0 0 0 0 0 0 0

Player’s joining status and game over text position.

  • # – Player number. Example: p1namej
  • name x – X axis name position from left side of screen.
  • name y – Y axis name position from top of screen.
  • select x – X axis “Select Hero” position from left side of screen.
  • select y – Y axis “Select Hero” position from top of screen.
  • start x – X axis “Press Start” and “Game Over” position from left side of screen.
  • start y – Y axis “Press Start” and “Game Over” position from top of screen.
  • font – Font number of text.

Player MP​

p#mp <x> <y>

Player’s MP (energy) gauge position. The MP gauge only appears if player entity has an MP supply defined. Otherwise identical to p#life.

Player Shoot (Ammo)​

p#shoot <x> <y> <font>

#default
p#shoot 0 0 0

Remaining weapon use count (see shootnum).

  • # – Player number. Example: p1shoot.
  • x – X axis position from left side of screen.
  • y – Y axis position from top of screen.
  • font – Font number of counter text.

Opponent​

Opponent HUD displays status of the last entity a player interacted with (hit, got hit by, etc.). Despite the name “enemy”, opponent HUD works for any entity type a player interacts with.

Enemy Icon​

e#icon <x> <y>

#default
e#icon 0 0
  • # – Player number. Example: e1icon.
  • x – X axis position from left side of screen.
  • y – Y axis position from top of screen.

Enemy Name​

e#name <x> <y> <font>

#default
e#name 0 0 0
  • # – Player number. Example: e1name
  • x – X axis position from left side of screen.
  • y – Y axis position from top of screen.
  • font – Font number of X.

Enemy Life​

e#life <x> <y>

#default
e#life 0 0
  • # – Player number. Example: e1life.
  • x – X axis position from left side of screen.
  • y – Y axis position from top of screen.

Model​

Default HUD​

Icon​

icon <path> <palette>

#default
icon none 0

Default icon displayed next to the entity’s life bar.

  • path – Path to icon image.
  • palette – Match entity’s palette.
    • 0 – Icon uses own palette.
    • 1 – Icon uses entity’s palette.

Icon, Pain​

iconpain <path> <palette>

If defined, replaces Icon when in pain state. Otherwise identical to Icon.

Icon, Die​

icondie <path> <palette>

If defined, replaces Icon when dead. Otherwise identical to Icon.

Icon, Get​

iconget <path> <palette>

If defined, replaces Icon when picking up an item. Otherwise identical to Icon.

Icon, MP

iconmpmax <path> <palette>
iconmphigh <path> <palette>
iconmphalf <path> <palette>
iconmplow <path> <palette>
iconmpnone <path> <palette>

# Default
iconmpmax none 0
iconmphigh none 0
iconmphalf none 0
iconmplow none 0
iconmpnone none 0

If defined, displays when MP percentage reaches a given threshold. Higher percentages take priority:

  1. max – >= 100%
  2. high – >= 75%
  3. half – >= 25%
  4. low – > 0%
  5. none – <= 0%
  • Path – Path to image file.
  • Palette – Palette source.
    • 0 – Use independent palette.
    • 1 – Use model palette (meaning icon will swap palettes if entity does).

Tips:

  • If you want the same icon to display for all thresholds, just define the same icon for each.
  • It’s very difficult (almost impossible) to have exactly 0 MP in normal game play using the default MP setup. If you want to use the none icon, you may want to modify the other MP settings.

Icon, Weapon​

iconw <path> <palette>

If defined, replaces Icon when carrying a weapon. Otherwise identical to Icon.

Tip: You can also create icons unique for a specific weapon by adding Icon to the weapon model text.

No HUD​

nolife <bi>

#default
nolife 0

If enabled, entity does not appear in HUD. Used mainly to hide enemy status from players.

Pop Up HUD​

Pop Up HUD properties set up an on screen status that displays at all times whenever the entity is active. Mainly used to create boss life bars.

HUD_example_2.png

Config​

lifebarstatus <w> <h> <noborder> <type> <orientation> <border> <shadow> <graph> <backfill>

#default
lifebarstatus 100 5 0 0 0 0 0 0 0
  • w – Maximum width of the gauge.
  • h – Height of the gauge in pixels.
  • noborder – Disables the border and shadow around gauges.
  • type– How values are displayed.
    • 0 – Absolute. The gauge represents a pixel per unit value. For example, if the value is 50, the gauge fills to 50 pixels. If the value exceeds gauge’s capacity, the gauge will wrap around and ‘double up’ on top of itself as many times as necessary.
    • 1 – Ratio. The gauge represents a percentage of the value’s maximum. For example, if the value is 50 and its maximum is 100 (e.g. 50%) the gauge will fill exactly half way.
  • orientation– Direction of gauge fill.
    • 0 – Left (empty) to right (full).
    • 1 – Bottom (empty) to top (full).
  • border – Layer adjustment of outer border. Default to 0.
  • shadow – Layer adjustment of border shadow. Default to 0.
  • graph – Layer adjustment of graph fill. Default to 0.
  • backfill – Layer adjustment graph background. Default to 0.

Position (HP)​

lifeposition <x> <y>

#default
lifeposition 0 0

Position of Pop Up HUD HP gauge.

  • x – X axis position from left side of screen.
  • y – Y axis position from top of screen.

Position (Name)​

nameposition <x> <y>

#default
nameposition 0 0

Position of Pop Up HUD HP gauge.

  • x – X axis position from left side of screen.
  • y – Y axis position from top of screen.

Position (Icon)​

iconposition <x> <y>

#default
iconposition 0 0

Position of Pop Up HUD HP gauge.

  • x – X axis position from left side of screen.
  • y – Y axis position from top of screen.

Script​

Icon​

Icon properties are accessible through the get_icon_property() and set_icon_property().

Get an icon property. The icon property functions accept an icon pointer and a property constant.

mixed x = get_icon_property(void <pointer>, int <identifier>);

Modify an icon property value.

mixed new_value = <value>;

set_icon_property(void <pointer>, int <identifier>, new_value);
ConstantTypeDescription
ICON_PROPERTY_DEFAULTIntegerDefault icon sprite index.
ICON_PROPERTY_DIEIntegerDie icon sprite index.
ICON_PROPERTY_GETIntegerGet icon sprite index.
ICON_PROPERTY_MP_HIGHIntegerMP high icon sprite index.
ICON_PROPERTY_MP_LOWIntegerMP low icon sprite index.
ICON_PROPERTY_MP_MEDIUMIntegerMP medium icon sprite index.
ICON_PROPERTY_PAINIntegerPain icon sprite index.
ICON_PROPERTY_POSITION_XIntegerX Axis icon position.
ICON_PROPERTY_POSITION_YIntegerY Axis icon position.
ICON_PROPERTY_USE_MAPIntegerIf true, icon uses entity’s palette.
ICON_PROPERTY_WEAPONIntegerWeapon icon sprite index.

Dial​

Dial is the internal structure housing the HUD properties dedicated to graphing a value’s status (ex. hit points).

Dial properties are accessible through the get_status_dial_property() and [/icode]set_status_dial_property()[/icode].

Get a dial property. The dial property functions accept a dial pointer and a property constant.

mixed x = get_status_dial_property(void <pointer>, int <identifier>);

Modify a dial property value. Some dial properties are read only – see the property list for details.

mixed new_value = <value>;

set_status_dial_property(void <pointer>, int <identifier>, new_value);

Pop up HUDs (i.e. boss HUD) are a model property. The default HUD and loading HUD are global. You can obtain their pointers with openborvariant().

  • openborvariant(“hud_common_main”) – Default in game HUD for player’s name and HP.
  • openborvariant(“hud_common_mp”) – Default in game HUD for player’s MP.
  • openborvariant(“hud_common_opponent”) – Default in game HUD for entity player last interacted with.
  • openborvariant(“hud_load”) – Loading bar at startup and between levels.
ConstantTypeDescription
STATUS_DIAL_PROPERTY_BACK_LAYERIntegerLayer position of back gill of the graph. Added to openborconstant(“HUD_Z”) + 1.
STATUS_DIAL_PROPERTY_BORDER_LAYERIntegerLayer position of border around graph. Added to openborconstant(“HUD_Z”) + 3.
STATUS_DIAL_PROPERTY_COLORSET_TABLEPointerPointer to array of color sets for graph bars. (in progress)
STATUS_DIAL_PROPERTY_CONFIG_FLAGSIntegerBitmasked with following constants:
openborconstant(“STATUS_CONFIG_NONE”) – No config. openborconstant(“STATUS_CONFIG_BORDER_DISABLE”) – Do not draw graph border. openborconstant(“STATUS_CONFIG_DEFAULT”) – Initial mask assigned. openborconstant(“STATUS_CONFIG_GRAPH_INVERT”) – Reverse graph direction, meaning horizontal graphs fill right to left and vertical graphs fill top to bottom. openborconstant(“STATUS_CONFIG_GRAPH_RATIO”) – Draw graph as percentage of the value’s maximum. openborconstant(“STATUS_CONFIG_GRAPH_VERTICAL”) – Orient graph vertically.
STATUS_DIAL_PROPERTY_GRAPH_LAYERIntegerLayer position of graph fill. Added to openborconstant(“HUD_Z”) + 2.
STATUS_DIAL_PROPERTY_GRAPH_POSITION_XIntegerX Axis position of graph from on screen.
STATUS_DIAL_PROPERTY_GRAPH_POSITION_YIntegerY Axis position of graph from on screen.
STATUS_DIAL_PROPERTY_GRAPH_SIZE_XIntegerGraph width. Maximum value displayable by absolute horizontal graph.
STATUS_DIAL_PROPERTY_GRAPH_SIZE_YIntegerGraph height. Maximum value displayable by absolute vertical graph.
STATUS_DIAL_PROPERTY_NAME_POSITION_XIntegerX Axis position of name/label text on screen.
STATUS_DIAL_PROPERTY_NAME_POSITION_YIntegerY Axis position of name/label text on screen.
STATUS_DIAL_PROPERTY_SHADOW_LAYERIntegerLayer position of shadow border around graph. Added to openborconstant(“HUD_Z”).

Spawn HUD​

Spawn HUD controls the optional graphic appearing when players spawn to a game in progress.

Spawn HUD properties are accessible through the get_spawn_hud_property() and set_[ICODE]spawn_hud_property()[/icode].

Get a spawn hud property. The spawn hud property functions accept a spawn hud pointer, a player index, and a property constant.

mixed x = get_spawn_hud_property(void <pointer>, int <index>, int <identifier>);

Modify a property value. In addition to the get parameters, you will need to provide the new value.

mixed new_value = <value>;

set_spawn_hud_property(void <pointer>, int <index>, int <identifier>, new_value);
ConstantTypeDescription
SPAWN_HUD_PROPERTY_POSITION_XIntegerX Axis distance from entity offset.
SPAWN_HUD_PROPERTY_POSITION_YIntegerY Axis distance from entity offset.
SPAWN_HUD_PROPERTY_SPRITEIntegerSprite index of graphic displayed.

Related Post