• GetTextSize() glitch in gmod?!?!
    0 replies, posted
Hey guys. I am working on my HUD and encountered a very mysterious glitch when using gettextsize for my hud. Here is a screenshot: Screen capture Here is my code:     lifestyletext = (("Life Style: " .. localplayer:getDarkRPVar("job")) or "Loading")     salarytext = (("Salary: " .. localplayer:getDarkRPVar("salary") .. " gold") or 0)     moneytext = (("Gold: " .. localplayer:getDarkRPVar("money")) or 0)     --Background     draw.RoundedBox( 12, 230, ScrH() - 163, surface.GetTextSize(lifestyletext) + 25, 23, Color( 0, 0,0, 190 ) ) -- Job         draw.SimpleText( lifestyletext, "DarkRPHUD2", 240, ScrH() - 163, Color( 255, 255, 255, 240 ) )     draw.RoundedBox( 12, 230, ScrH() - 133, 192, 23, Color( 0, 0,0, 190 ) ) -- Salary             draw.SimpleText( salarytext, "DarkRPHUD2", 240, ScrH() - 133, Color( 255, 255, 255, 240 ) )     draw.RoundedBox( 12, 230, ScrH() - 103, 192, 23, Color( 0, 0,0, 190 ) ) -- Gold                 draw.SimpleText( moneytext, "DarkRPHUD2", 240, ScrH() - 103, Color( 255, 255, 255, 240 ) )     draw.RoundedBox( 12, 230, ScrH() - 73, 192, 23, Color( 0, 0,0, 190 ) ) -- Level                 draw.SimpleText( level, "DarkRPHUD2" or 0, 240, ScrH() - 73, Color( 255, 255, 255, 255 ) )       draw.RoundedBox( 12, 230, ScrH() - 43, 192, 23, Color( 0, 0,0, 190 ) ) -- Wealth                 draw.SimpleText( "Wealth: " .. moneyStr or "Loading", "DarkRPHUD2", 238, ScrH() - 43, Color( 0, 135, 0, 140 ) )                      surface.SetMaterial(Texture1)     surface.SetDrawColor(Color(195, 195, 195, 195))     surface.DrawTexturedRect(20, ScrH()-233, 220, 220, Color(195, 195, 195, 195)) If anyone can tell me how I can fix this, that would be great. Thanks!
Sorry, you need to Log In to post a reply to this thread.