When I do :
[CODE]HUD.name = HUD:Add("DLabel")
HUD.name:SetPos(180,40)
HUD.name:SetSize(200, 30)
HUD.name:SetTextColor(Color(180, 180, 180))
HUD.name:SetFont("HUD_name")
function HUD.name:Think()
if !IsValid(LocalPlayer()) then return end
if self:GetText() != LocalPlayer():Name() then
HUD.name:SetText(LocalPlayer():Name())
HUD.name:SetTextColor(Color(180, 180, 180))
end
end[/CODE]
The text is blank, if I remove the hook Think then settext without, the text is grey,
I tested SetColor and SetTextColor both are the same,
Tested to SetTextColor only one time, after or before the SetText in the hook too, it's the same
This is buggy since the last patch (was buggy on DEV BRANCH too but not on public release)
how to fix ? heeelp :v:
edit:
Oh okay, just saw robotboy655 said :
"Yes, I am aware of the color issues, I will get to it later today. ( Goddamn DLabel and its unnecessarily complicated text color functions )"
Anyone got a tempfix?
First of all, this piece of code:
[code]
HUD.name:Think()
if !IsValid(LocalPlayer()) then return end
if self:GetText() != LocalPlayer():Name() then
HUD.name:SetText(LocalPlayer():Name())
HUD.name:SetTextColor(Color(180, 180, 180))
end
end[/code]
Would never work ( Syntax errors )
But the text colors on DLabel should work after todays update.
I forgot to copy function before HUD.name:Think() but my code has it and was working before ^^
But well, ok, I'll wait ! thank you !
If you wanna help, you should try testing your code in the [url=http://wiki.garrysmod.com/page/Dev_Branch]Dev Branch[/url]. It should work there once it updates with latest changes.
Sorry, you need to Log In to post a reply to this thread.