surface libraryclient
Part of Flow
Summary
Functions
Functions
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
100amount 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:265Draws 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
1width of the ring in pixels - passes Number optional, defaults to
100amount 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:289Draws 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
1width of the ring in pixels - passes Number optional, defaults to
360amount of segments a full circle would have
surface.draw_circle_partial(percentage, x, y, radius, passes)
client packages/flow/core/cl_core.lua:222Draws 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
360amount of segments a full circle would have
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)
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:90Draws 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:65Draws 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
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