My clientside code
include("shared.lua")
surface.CreateFont( "maintext", {
font = "Arial", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
extended = false,
size = 80,
weight = 1000,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = false,
} )
function ENT:Draw()
self:DrawModel()
local Pos = self:GetPos()
local Ang = self:GetAngles()
Ang:RotateAroundAxis(Ang:Up(), 90)
cam.Start3D2D(Pos + Ang:Up() * 200 - Ang:Right() * - 5 + Ang:Forward() * -0.50, Ang + Angle( 0, 0, 90 ), 0.067)
surface.SetDrawColor( 0,0,0,150 )
surface.DrawRect( -350, 43, 700, 120 )
surface.SetDrawColor( 255,255,255,150 )
surface.DrawOutlinedRect( -350, 45, 700, 120)
draw.SimpleText( "HELLO", "maintext", 0, 46, Color(255,255,255,150), 1, 0 )
cam.End3D2D()
end
https://i.imgur.com/RkXBWbc.jpg
It seems like your offsets are incorrect since the black rectangle isn't showing either. If you noclip around the ent and look at it from different angles, do you ever see it? Try looking inside the ent too.
i have fixed the text but atm im trying to make a button remember the other post 3d2d buttons
so when i do that code
local POSITION = Vector(1, 2, 3)
local ANGLES = Angle(0, 0, 0)
local SCALE = 0.25
local ANGLES_ZERO = Angle(0, 0, 0)
function ENT:GetCursorPos(client)
local position = self:LocalToWorld(POSITION)
local angles = self:LocalToWorldAngles(ANGLES)
local hitPos = client:GetEyeTrace().HitPos
local pos = WorldToLocal(hitPos, ANGLES_ZERO, position, angles)
return pos.x / SCALE, pos.y / -SCALE
end
function ENT:Draw()
cam.Start3D2D(self:LocalToWorld(POSITION), self:LocalToWorldAngles(ANGLES), SCALE)
local cursorX, cursorY = self:GetCursorPos(LocalPlayer())
surface.SetDrawColor(255, 0, 255)
surface.DrawRect(cursorX - 2, cursorY - 2, 4, 4)
cam.End3D2D()
end
it makes my model invisible literally my model disappears?
You need to actually call self:DrawModel() in ENT:Draw()
i fixed all this
Sorry, you need to Log In to post a reply to this thread.