I’m currently working on a project where I’m trying to draw a rectangle on a panel using Surface.DrawPoly.
But I’m having problems with that the rectangle won’t draw directly. It skips a few frames until it starts to draw.
Code snippet (Removed comments and other unnecessary stuff)
local PanelWidth = ScrW() * 0.33
local TriSideLengths = PanelWidth * 0.3
local TriUpperLeft = {
{x = 0, y = 0},
{x = TriSideLengths, y = 0},
{x = 0, y = TriSideLengths}
}
self.Frame.Paint = function(_,w,h)
surface.SetDrawColor(Color(240,97,41))
surface.DrawPoly(TriUpperLeft)
end