I added a couple of icons from FamFam Silk Icon pack.
I took the money.vmt and money.vtf and put it in gui/silkicons
[code]draw.TexturedQuad({
texture=surface.GetTextureID("gui/silkicons/money"),
//texture="gui/gradient",
//color=Color(255, 255, 255, 255),
x=(ScrW()/10)*3.66,
y=RelativeY-30,
w=16,
h=16
})
[/code]
I used that code, and it shows up as a missing texture. Why i change it to gui/silkicons/user it works just fine. Why is it doing this?
-snip- read it wrong
surface.GetTextureID should never be called more than once, as it will pow down your FPS.
[lua]
local money_id = surface.GetTextureID("gui/silkicons/money")
hook.Add("HUDPaint", "MoneyPaint", function()
draw.TexturedQuad({
texture=money_id,
//texture="gui/gradient",
//color=Color(255, 255, 255, 255),
x=(ScrW()/10)*3.66,
y=RelativeY-30,
w=16,
h=16
})
end)
[/lua]
To your actual issue, try do print(money_id) just after you declare it, if it prints 0 or -1, it means that it's a invalid texture, if not, I'm not sure.
Sorry, you need to Log In to post a reply to this thread.