armorhud.swf
A compact HUD element that shows the player's Battle Block (called armor internally) as a hexagonal fill gauge with a numeric readout. Appears in adventure, PvP, build, and discovery modes; the frame graphic switches between an adventure/PvP and a build/discovery variant.
Document/main class: ArmorHudUI (extends _kiwi.Core.UIComponent)
SWF-specific classes: 2
Main class: ArmorHudUI
ArmorHudUI is a minimal HUD widget. The constructor validates that fill_mc and fillMask_mc exist on the timeline, caches maskInitialY, and immediately calls updateUI() to render the initial state. A single frame script at frame 1 calls stop().
configUI() registers five Iggy callbacks. When not in Iggy (authoring preview) it defaults to MODE_ADVENTURE mode.
The "armor" this widget shows is what the game calls Battle Block: the language files name it so ($StoreProduct_armor_name is "Battle Block", $Armor_Depleted is "Battle Block DEPLETED! I hope you have some flasks…").
Public methods
setCurrentArmor(value:Number) : void— storescurrentArmorif ≥ 0. Draws nothing; the engine sends the values and callsonUpdateUI(true)separately to redraw.setMaxArmor(value:Number) : void— storesmaxArmorif ≥ 0. Draws nothing, likesetCurrentArmor.updateUI() : void— computes fill ratiocurrentArmor / maxArmor; movesfillMask_mc.yby(1 - ratio) * armorFullHeight(65 px full range) to clipfill_mcfrom the top; setsarmorText.textto a digit-delimited number viaKiwiTextUtil.addDigitDelimiters.onUpdateUI(redraw:Boolean) : void— callsupdateUI()ifredrawis true; otherwise no-op.setVisibility(visible:Boolean) : void— setsthis.visible.setMode(mode:String) : void— sendshexFrame_mcto frame 2 for"build"or"discovery"(alternate graphic), frame 1 for"adventure"or"pvp"(default graphic); then callsupdateUI().
Key fields
armorText : TextField— numeric armor value display.fill_mc : MovieClip— the colored fill graphic (clipped by mask).fillMask_mc : MovieClip— mask that slides vertically to revealfill_mcproportionally.hexFrame_mc : MovieClip— the hexagonal border; frame 1 = combat, frame 2 = build/discovery.maxArmor : Number— maximum armor for ratio calculation.currentArmor : Number— current armor value.shieldWidth : Number = 55— unused reference dimension.armorFullHeight : Number = 65— full pixel height of the fill range.maskInitialY : Number—fillMask_mc.yat construction (base of the gauge).- Mode constants:
MODE_ADVENTURE = "adventure",MODE_BUILD = "build",MODE_PVP = "pvp",MODE_DISCOVERY = "discovery".
Frame scripts / timeline
- Frame 1 —
stop(). Single static frame; no animation.
Runtime dependencies & integration
ExternalInterface callbacks registered (Iggy):
setCurrentArmor— updates stored armor valuesetMaxArmor— updates stored max armoronUpdateUI— conditionally redrawssetVisibility— show/hide the widgetsetMode— switches frame graphic and redraws
No ExternalInterface calls are made outward — this widget is display-only; it only receives data from the game engine.
KiwiTextUtil.addDigitDelimiters — formats the armor number with thousands separators for display.
Placement: the engine places this 65×76 box itself, next to the hotbar's; no layout file in the install mentions armorhud, so the position is decided inside the client. At 2560×1369 its origin lands at (879, 1229), 8 px left of and 32 px above the hotbar's box at (887, 1261).
Other game-specific classes
ArmorHUD_fla/hexFrame_mc_3 (extends MovieClip) — [Embed symbol14]
The hexagonal border frame symbol. Two frames (both stop()): frame 1 = default (adventure/PvP border style), frame 2 = alternate (build/discovery border style). Switched by ArmorHudUI.setMode.
Notable logic
- Mask-based fill: Rather than scaling
fill_mc, the gauge works by slidingfillMask_mcdownward from the top: an empty gauge moves the mask tomaskInitialY + armorFullHeight(fully covering the fill), while a full gauge leaves it atmaskInitialY(fully revealing it). This preserves the hexagonal shape of the fill graphic. - Mode-gated frame: Only two visual states exist for the frame border (
hexFrame_mc); PvP uses the same frame as adventure, and discovery uses the same as build. - No stage-resize handling: Unlike most UIComponent subclasses,
ArmorHudUIdoes not overrideonStageResized; the widget is intended to be positioned and scaled externally by the HUD layout system.