Log in

View Full Version : [HUD] Shadow on Text



Avani
09-14-2013, 10:26 PM
Easy addition and looks really cool:
The only problem with my LUA below is that when you try to move the text it only moves the original, not the shadow.

Sample picture from Avani's Dicer (http://forums.xenobot.net/showthread.php?16499-Avani-Dice-Script-Safe-and-fast)
http://i44.tinypic.com/2f0aotl.png


xHUD = {}

function xHUD.New(x, y, value, r, g, b, shadow)
if (shadow == nil) then shadow = false end
local c = {}
setmetatable(c, HUD)
if (type(value) == 'number') then
c._pointer = HUDCreateItemImage(x, y, value, r, g)
else
if shadow == true then
c._pointer = HUDCreateText(x+1, y+1, value, 0, 0, 0)
end
c._pointer = HUDCreateText(x, y, value, r, g, b)
end
return c
end

Ropiderz
09-14-2013, 10:58 PM
Also border texts and option to change font used.

And in your script you should create 2 HUD objects so when you change their position, it'll move both.

xHUD = {}
function xHUD.New(x, y, value, r, g, b, shadow)
local HUDshadow
if (shadow == nil) then shadow = false end
local c = {}
setmetatable(c, HUD)
if (type(value) == 'number') then
c._pointer = HUDCreateItemImage(x, y, value, r, g)
else
if shadow == true then
HUDshadow = xHUD.New(x+1, y+1, value, 0, 0, 0, false)
end
c._pointer = HUDCreateText(x, y, value, r, g, b)
end
return c, HUDshadow
end