Summary

Functions

Draws a filled circle in the current surface draw color.
Draws a ring in the current surface draw color.
Draws a part of a ring in the current surface draw color, starting at the top and going clockwise.
Draws a filled sector of a circle in the current surface draw color, starting at the top and going clockwise.
Runs a drawing callback with everything it draws rotated around the given point.
Runs a drawing callback with everything it draws scaled around the given point.
Draws text rotated around its top left corner.
Draws text scaled around its top left corner.
Checks whether the mouse cursor is inside a rectangle given in screen coordinates.

Functions

surface.draw_circle(x, y, radius, passes)

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

Draws a filled circle in the current surface draw color. Raises an error if x, y or radius is missing. The vertices are cached by the arguments, up to 512 sets of them.

Parameters

  • x Number screen x of the center
  • y Number screen y of the center
  • radius Number
  • passes Number optional, defaults to 100 amount of segments; more of them make a smoother circle

surface.draw_circle_outline(x, y, radius, thickness, passes)

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

Draws a ring in the current surface draw color. Uses the stencil buffer.

Parameters

  • x Number screen x of the center
  • y Number screen y of the center
  • radius Number outer radius
  • thickness Number optional, defaults to 1 width of the ring in pixels
  • passes Number optional, defaults to 100 amount of segments; more of them make a smoother circle

surface.draw_circle_outline_partial(percentage, x, y, radius, thickness, passes)

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

Draws a part of a ring in the current surface draw color, starting at the top and going clockwise. Uses the stencil buffer.

Parameters

  • percentage Number how much of the ring to draw, from 0 to 100
  • x Number screen x of the center
  • y Number screen y of the center
  • radius Number outer radius
  • thickness Number optional, defaults to 1 width of the ring in pixels
  • passes Number optional, defaults to 360 amount of segments a full circle would have

surface.draw_circle_partial(percentage, x, y, radius, passes)

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

Draws a filled sector of a circle in the current surface draw color, starting at the top and going clockwise. Raises an error if percentage, x, y or radius is missing.

Parameters

  • percentage Number how much of the circle to draw, from 0 to 100
  • x Number screen x of the center
  • y Number screen y of the center
  • radius Number
  • passes Number optional, defaults to 360 amount of segments a full circle would have

surface.draw_rotated(pos_x, pos_y, angle, callback)

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

Runs a drawing callback with everything it draws rotated around the given point. Errors raised inside the callback are caught and reported.

Parameters

  • pos_x Number screen x of the rotation origin
  • pos_y Number screen y of the rotation origin
  • angle Number rotation in degrees
  • callback Function draws the contents; called with (pos_x, pos_y, angle)

surface.draw_scaled(pos_x, pos_y, scale, callback)

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

Runs a drawing callback with everything it draws scaled around the given point. Errors raised inside the callback are caught and reported.

Parameters

  • pos_x Number screen x of the scaling origin
  • pos_y Number screen y of the scaling origin
  • scale Number scale factor, 1 for the normal size
  • callback Function draws the contents; called with (pos_x, pos_y, scale)

surface.draw_text_rotated(text, font_name, pos_x, pos_y, angle, color)

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

Draws text rotated around its top left corner.

Parameters

  • text String
  • font_name String
  • pos_x Number screen x of the text
  • pos_y Number screen y of the text
  • angle Number rotation in degrees
  • color Color

surface.draw_text_scaled(text, font_name, pos_x, pos_y, scale, color)

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

Draws text scaled around its top left corner.

Parameters

  • text String
  • font_name String
  • pos_x Number screen x of the text
  • pos_y Number screen y of the text
  • scale Number scale factor, 1 for the normal size
  • color Color

surface.mouse_in_rect(x, y, w, h)

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

Checks whether the mouse cursor is inside a rectangle given in screen coordinates.

Parameters

  • x Number
  • y Number
  • w Number width
  • h Number height

Returns

  • Boolean

Defined in