- Joined
- Feb 28, 2007
- Messages
- 3,479
Hello again,
I'm getting a migraine from trying to make a simple healthbar with a text-frame on top.
My code is below:
The result in-game looks like this:
So the "a" is drawn, although in the wrong spot, and that's about it.
I tried messing with text alignments and z-values of different frames and what not but nothing seems to work for me.
Any help would be greatly appreciated, thanks!
Edit: Probably solved, apparently we can't draw text outside the 4:3 area.
I'm getting a migraine from trying to make a simple healthbar with a text-frame on top.
My code is below:
JASS:
globals
private framehandle UI_BackBar_HP
public framehandle UI_Bar_HP
public framehandle UI_HP_Text
endglobals
private function Actions takes nothing returns nothing
call BlzHideOriginFrames(true)
call BlzEnableUIAutoPosition(false)
call BlzFrameSetSize(BlzGetFrameByName("ConsoleUIBackdrop",0), 0, 0.0001)
set UI_BackBar_HP = BlzCreateFrame("EscMenuControlBackdropTemplate", BlzGetFrameByName("ConsoleUIBackdrop", 0), 0, 0)
set UI_Bar_HP = BlzCreateFrameByType("SIMPLESTATUSBAR", "", BlzGetFrameByName("ConsoleUI", 0), "", 0)
call BlzFrameSetAbsPoint(UI_BackBar_HP, FRAMEPOINT_CENTER, -0.03, 0.57)
call BlzFrameSetSize(UI_BackBar_HP, 0.2, 0.025)
call BlzFrameSetPoint(UI_Bar_HP, FRAMEPOINT_TOPLEFT, UI_BackBar_HP, FRAMEPOINT_TOPLEFT, 0.006, -0.006)
call BlzFrameSetPoint(UI_Bar_HP, FRAMEPOINT_BOTTOMRIGHT, UI_BackBar_HP, FRAMEPOINT_BOTTOMRIGHT, -0.006, 0.006)
call BlzFrameSetTexture(UI_Bar_HP, "ui\\feedback\\xpbar\\human-bigbar-fill", 0, false)
call BlzFrameSetVertexColor(UI_Bar_HP, BlzConvertColor(255, 55, 255, 55))
call BlzFrameSetVertexColor(UI_BackBar_HP, BlzConvertColor(255, 55, 255, 55))
set UI_HP_Text = BlzCreateFrameByType("TEXT", "MyTextFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
call BlzFrameSetEnable(UI_HP_Text, true)
call BlzFrameSetPoint(UI_HP_Text, FRAMEPOINT_CENTER, UI_Bar_HP, FRAMEPOINT_CENTER, 0.0, 0.0)
call BlzFrameSetScale(UI_HP_Text, 2)
call BlzFrameSetText(UI_HP_Text, "abc def")
endfunction
The result in-game looks like this:
So the "a" is drawn, although in the wrong spot, and that's about it.
I tried messing with text alignments and z-values of different frames and what not but nothing seems to work for me.
Any help would be greatly appreciated, thanks!
Edit: Probably solved, apparently we can't draw text outside the 4:3 area.
Last edited: