I've thrown together something. It's untested though. So I am not sure if it will work out of the box.
Paste the code into
http://addon.bool.no
Name your new addon "BigHealth".
Create a new image (see
http://wow.gamepedia.com/TGA_files if you're running into problems) with the name digits.tga (eg. width 1024px, height 128px) and save it into your new addon (BigHealth) folder. Edit the image to contain the numbers from 0 to 9 from left to right. Each number should have a size of ~ 102 x 128 (w/h) pixels. The resulting image should look like "0123456789".
The addon will create a movable frame with 3 textures showing numbers. The number texture is taken from the appropiate area of the texture file.
Lua Code:
local xPosition = 0
local yPosition = 0
local digitHeight = 100
local digitWidth = 50
local AddonName, Addon = ...
function Addon:CreateHealthFrame()
Addon.HealthFrame = CreateFrame("Frame", "HealthFrame", UIParent)
Addon.HealthFrame:SetFrameStrata("HIGH")
Addon.HealthFrame:SetPoint("CENTER", UIParent, "CENTER", xPosition, yPosition)
Addon.HealthFrame:SetHeight(digitHeight)
Addon.HealthFrame:SetWidth(digitWidth * 3)
Addon.HealthFrame:SetBackdrop({bgFile="Interface\\Tooltips\\UI-Tooltip-Background", edgeFile="", tile = false, tileSize = 1, edgeSize = 10, insets = { left = 0, right = 0, top = 0, bottom = 0 }})
Addon.HealthFrame:SetBackdropColor(0, 0, 0, 1)
Addon.HealthFrame:SetClampedToScreen(true)
Addon.HealthFrame:SetScript("OnDragStart", function(self)
self:StartMoving()
end)
Addon.HealthFrame:SetScript("OnDragStop", function(self)
self:StopMovingOrSizing()
end)
Addon.HealthFrame:SetMovable(true)
Addon.HealthFrame:RegisterForDrag("LeftButton")
Addon.HealthFrame:EnableMouse(true)
Addon.HealthFrame.digit1 = HealthFrame:CreateTexture("Digit1","ARTWORK")
Addon.HealthFrame.digit1:SetPoint("TOPLEFT", HealthFrame, "TOPLEFT", 0, 0)
Addon.HealthFrame.digit1:SetHeight(digitHeight)
Addon.HealthFrame.digit1:SetWidth(digitWidth)
Addon.HealthFrame.digit1:SetTexture("Interface\\Addons\BigHealth\\digits.tga")
Addon.HealthFrame.digit2 = HealthFrame:CreateTexture("Digit2","ARTWORK")
Addon.HealthFrame.digit2:SetPoint("TOPLEFT", HealthFrame, "TOPLEFT", digitWidth, 0)
Addon.HealthFrame.digit2:SetHeight(digitHeight)
Addon.HealthFrame.digit2:SetWidth(digitWidth)
Addon.HealthFrame.digit2:SetTexture("Interface\\Addons\BigHealth\\digits.tga")
Addon.HealthFrame.digit3 = HealthFrame:CreateTexture("Digit3","ARTWORK")
Addon.HealthFrame.digit3:SetPoint("TOPLEFT", HealthFrame, "TOPLEFT", digitWidth * 2, 0)
Addon.HealthFrame.digit3:SetHeight(digitHeight)
Addon.HealthFrame.digit3:SetWidth(digitWidth)
Addon.HealthFrame.digit3:SetTexture("Interface\\Addons\BigHealth\\digits.tga")
Addon.HealthFrame:SetScript("OnEvent", function(pSelf, pEvent, pUnitID)
if pUnitID == "player" then
local tHealth = UnitHealth("player")
local percentStr = format('%03d', (tHealth / tHealth + 0.005) * 100)
pSelf.digit1:SetTexCoord(percentStr:sub(1, 1) / 10, (percentStr:sub(1, 1) / 10) + 0.1, 1, 0)
pSelf.digit2:SetTexCoord(percentStr:sub(2, 2) / 10, (percentStr:sub(2, 2) / 10) + 0.1, 1, 0)
pSelf.digit3:SetTexCoord(percentStr:sub(3, 3) / 10, (percentStr:sub(3, 3) / 10) + 0.1, 1, 0)
end
end)
HealthFrame:RegisterEvent("UNIT_HEALTH")
end
Addon:CreateHealthFrame()