draw libraryclient
Part of Flow
Client-side drawing helpers of the Flux core.
surface gains scaled and rotated text and drawing blocks, circles, sectors and rings.
draw gains stencil cutouts, outlined, textured and plain boxes, lines and blurred
backgrounds. Flux gains the circular action indicator, the spinning cog and simple
position animations. The file also derives the gamemode from sandbox on the client and
sets up the materials and the settings of the blur effect.
Summary
Functions
Functions
Draws a blurred copy of the screen inside a rectangle given in screen coordinates. To be called outside of a panel. Also requests the blur texture to be kept up to date.
Parameters
- x Number
- y Number
- w Number width
- h Number height
Draws a blurred copy of the screen behind a panel, using the position reported by panel:GetPos() and the size of the panel. Also requests the blur texture to be kept up to date.
Parameters
- panel Panel
Draws a solid rectangle.
Parameters
- x Number
- y Number
- w Number width
- h Number height
- color Color optional, defaults to
Color(255, 255, 255)
draw.box_outlined(rounding, x, y, w, h, thickness, color, rounding2)
client packages/flow/core/cl_core.lua:346Draws the outline of a rounded box, leaving its inside untouched.
Parameters
- rounding Number corner radius of the outer edge
- x Number
- y Number
- w Number width
- h Number height
- thickness Number width of the outline in pixels
- color Color
- rounding2 Number optional, defaults to
roundingcorner radius of the inner edge
See also
Draws a line between two points.
Parameters
- x Number x of the first point
- y Number y of the first point
- x2 Number x of the second point
- y2 Number y of the second point
- color Color
Sets the strength of the blur used by draw.blur_box and draw.blur_panel.
Parameters
- size Number optional, defaults to
12
Returns
- Number the size that was set
Draws with a cutout: whatever draw_func draws is only visible outside of the area that stencil_func draws. Does nothing unless both arguments are functions.
-- A 2 pixel wide frame: the outer box minus the inner box.
draw.stenciled(function()
draw.RoundedBox(0, x, y, w, h, color)
end, function()
draw.RoundedBox(0, x + 2, y + 2, w - 4, h - 4, color)
end)
Parameters
- draw_func Function draws the visible contents; called without arguments
- stencil_func Function draws the area to cut out; its output is not shown
Draws a rectangle textured with a material. Does nothing if no material is given.
Parameters
- material Material
- x Number
- y Number
- w Number width
- h Number height
- color Color optional, defaults to
Color(255, 255, 255)tint of the material