• Surface problem
    5 replies, posted
After drawing my HUD it seems to be causing this: [img]http://img200.imageshack.us/img200/7595/derpl.png[/img] Any idea on how i would go about fixing this?
[QUOTE=MayorBee;28925444]Any idea on how i would go about fixing this?[/QUOTE] Yeah, you should post your code first.
Sorry forgot it, here you go: [lua] // mats["HUDLBase"].id is a texture id // mats["HUDLBase"].w and mats["HUDLBase"].w is the texture size function DrawHUD() local HP = LocalPlayer():Health()/2.77 HP = math.floor(HP) HP = math.Clamp(HP,1,100) surface.SetDrawColor(HUDColor) surface.SetTexture(mats["HUDLBase"].id) surface.DrawTexturedRect(HUDBaseX,HUDBaseY, mats["HUDLBase"].w, mats["HUDLBase"].h) surface.SetDrawColor(Color(HUDColor.r,HUDColor.g,HUDColor.b,190)) surface.SetTexture(mats["HUDHPText"].id) surface.DrawTexturedRect(HUDBaseX+22,HUDBaseY-2, mats["HUDHPText"].w/6, mats["HUDHPText"].h/6) end [/lua]
That's not enough. Post all of your code. Something is going wrong in the way your are drawing your HUD, how is your DrawHUD function called?
That looks like gm_clearfonts was called.
[QUOTE=_Kilburn;28928886]That's not enough. Post all of your code. Something is going wrong in the way your are drawing your HUD, how is your DrawHUD function called?[/QUOTE] The rest of my code is just adding a HUDPaint hook for DrawHUD and the function that adds the mats table. [QUOTE=Wizard of Ass;28929495]That looks like gm_clearfonts was called.[/QUOTE] After looking through some lua files i found that it was being called in a different file. So i deleted the file and it works now thanks :D
Sorry, you need to Log In to post a reply to this thread.