• Black material with just the shape
    3 replies, posted
Hi! I am talking to you today for a little problem. I changed the DrawVoiceChat() function of the DarkRP, located in gamemode->modules->hud->cl_hud.lua Without know why, depending on the starting, sometimes I've the good icon at the right, but generally (95%), the texture is deformed : too dark, or just entirely black. The code : [code] local VoiceChatTexture = Material( "mymaterial/mymaterial.png" ) local function DrawVoiceChat() if localplayer.DRPIsTalking then local _, chboxY = chat.GetChatBoxPos() local Rotating = math.sin(CurTime() * 3) if Rotating < 0 then Rotating = 1 - (1 + Rotating) end surface.SetMaterial(VoiceChatTexture) surface.DrawTexturedRectRotated(ScrW() - 100, chboxY, Rotating * 96, 96, 0) end end [/code] Image of the black "material" : [URL=http://www.hostingpics.net/viewer.php?id=929696MATERIAL.png][IMG]http://img15.hostingpics.net/pics/929696MATERIAL.png[/IMG][/URL] So I search a way to see the texture right when speaking, and still functional. (I think that SetMaterial is not a good way).. If one person can give me the right solution... Thanks by advance!
use surface.SetDrawColor(Color(255,255,255)) before surface.SetMaterial()
Yeah, that was it. Thanks.
[url]http://corefiles.darkrp.eu[/url]
Sorry, you need to Log In to post a reply to this thread.