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

Draws a blurred copy of the screen inside a rectangle given in screen coordinates.
Draws a blurred copy of the screen behind a panel, using the position reported by panel:GetPos() and the size of the panel.
Draws a solid rectangle.
Draws the outline of a rounded box, leaving its inside untouched.
Draws a line between two points.
Sets the strength of the blur used by draw.blur_box and draw.blur_panel.
Draws with a cutout: whatever draw_func draws is only visible outside of the area that stencil_func draws.
Draws a rectangle textured with a material.

Functions

draw.blur_box(x, y, w, h)

client packages/flow/core/cl_core.lua:399

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

draw.blur_panel(panel)

client packages/flow/core/cl_core.lua:412

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

draw.box(x, y, w, h, color)

client packages/flow/core/cl_core.lua:379

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:346

Draws 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 rounding corner radius of the inner edge

See also

draw.line(x, y, x2, y2, color)

client packages/flow/core/cl_core.lua:430

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

draw.set_blur_size(size)

client packages/flow/core/cl_core.lua:387

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

draw.stenciled(draw_func, stencil_func)

client packages/flow/core/cl_core.lua:318

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

draw.textured_rect(material, x, y, w, h, color)

client packages/flow/core/cl_core.lua:363

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

Defined in