Hello All,
I have a problem where when i look at an entity the cam 2D3D works like it should but when i look away the text becomes off center and i dont know how to fix it
When i look at the entity:
[SPOILER]
[IMG]http://images.akamai.steamusercontent.com/ugc/46506032900578172/7B0F540FADA5367397D2AA3BFBBD2880518041F5/[/IMG]
[URL="http://images.akamai.steamusercontent.com/ugc/46506032900578172/7B0F540FADA5367397D2AA3BFBBD2880518041F5/"]http://images.akamai.steamusercontent.com/ugc/46506032900578172/7B0F540FADA5367397D2AA3BFBBD2880518041F5/[/URL]
[/SPOILER]
When i look away from the entity:
[SPOILER]
[IMG]http://images.akamai.steamusercontent.com/ugc/46506032900577830/81929BC5273366083D1E2B160CF66B949EC97C89/[/IMG]
[URL="http://images.akamai.steamusercontent.com/ugc/46506032900577830/81929BC5273366083D1E2B160CF66B949EC97C89/"]http://images.akamai.steamusercontent.com/ugc/46506032900577830/81929BC5273366083D1E2B160CF66B949EC97C89/[/URL]
[/SPOILER]
Code:
[LUA]
cam.Start3D2D(Pos, Ang, 0.1)
draw.RoundedBox(0, -50, 0, 100, 60,Color(10, 170, 255, 200))
if not self:GetOutletOwner():IsPlayer() then
local message = "No Owner"
local width, height = surface.GetTextSize( message )
draw.SimpleText(message,"Trebuchet18", -(width/2), 14, Color(255, 255, 255, 200))
else
local message = "Owner: "..self:GetOutletOwner():Nick()
local width, height = surface.GetTextSize( message )
draw.SimpleText(message,"Trebuchet18", -(width/2), 14, Color(255, 255, 255, 200))
end
cam.End3D2D()
[/LUA]
show the Pos and Ang definitions
Set the font before checking the size.
[QUOTE=James xX;47839820]Set the font before checking the size.[/QUOTE]
Thanks that worked i just added
[LUA]
surface.SetFont("Trebuchet18")
[/LUA]
after the draw.roundedbox and it worked fine
Sorry, you need to Log In to post a reply to this thread.