cdraw libraryclient
Defines the client-side global cdraw drawing library and creates the Derma, DermaBold, DermaThin,
DermaGlow, DermaNarrow, DermaNarrowBold, Exo and ExoBold fonts in every size from 1 to 72.
cdraw draws boxes, text in those sized fonts, blurred boxes (cdraw.DrawSimpleBlurBox, cdraw.DrawBlurBox) and
the slanted polygons and progress bar of the UI (cdraw.DrawEZPoly, cdraw.PolyBar). The file also adds
util.GetTextSize.
Summary
Functions
panel_primarycolor option color.Functions
cdraw.DrawBlurBox(px, py, x, y, w, h, color, blurAmt)
client gamemodes/catwork/gamemode/core/libraries/cl_clouddraw.lua:163Draws a box that blurs what is behind it, at a position inside a panel.
Must be called from a panel's Paint. The blur strength is always 4;
blurAmt is ignored.
Parameters
- px Number Horizontal screen position of the panel
- py Number Vertical screen position of the panel
- x Number Horizontal position of the box inside the panel
- y Number Vertical position of the box inside the panel
- w Number Width
- h Number Height
- color Color Color of the box drawn under the blur
- blurAmt Number optional, defaults to
nilUnused
See also
cdraw.DrawBox(x, y, w, h, color, RoundAmt)
client gamemodes/catwork/gamemode/core/libraries/cl_clouddraw.lua:94Draws a rounded box.
Parameters
- x Number Horizontal position
- y Number Vertical position
- w Number Width
- h Number Height
- color Color optional, defaults to
Color(200,200,200)Fill color - RoundAmt Number optional, defaults to
4Corner radius
cdraw.DrawEZHalfPoly(x1, y1, w, h, pct, col)
client gamemodes/catwork/gamemode/core/libraries/cl_clouddraw.lua:220Draws a box whose right edge slants outwards towards the bottom.
Parameters
- x1 Number Horizontal position of the top left corner
- y1 Number Vertical position of the top left corner
- w Number Width of the top edge
- h Number Height
- pct Number How far the bottom right corner extends past the top right one, in pixels
- col Color Fill color
cdraw.DrawEZHalfPolyRight(x1, y1, w, h, pct, col)
client gamemodes/catwork/gamemode/core/libraries/cl_clouddraw.lua:240Draws a box whose left edge slants outwards towards the bottom.
Parameters
- x1 Number Horizontal position of the top left corner
- y1 Number Vertical position of the top left corner
- w Number Width of the top edge
- h Number Height
- pct Number How far the bottom left corner extends past the top left one, in pixels
- col Color Fill color
cdraw.DrawEZPoly(x1, y1, w, h, pct, col)
client gamemodes/catwork/gamemode/core/libraries/cl_clouddraw.lua:200Draws a parallelogram whose bottom edge is shifted to the right.
Parameters
- x1 Number Horizontal position of the top left corner
- y1 Number Vertical position of the top left corner
- w Number Width of the top edge
- h Number Height
- pct Number Horizontal offset of the bottom edge in pixels
- col Color Fill color
cdraw.DrawPanelBase(name, x, y, w, h)
client gamemodes/catwork/gamemode/core/libraries/cl_clouddraw.lua:189Draws a box in the theme's panel_primarycolor option color.
Parameters
- name Any Unused
- x Number Horizontal position
- y Number Vertical position
- w Number Width
- h Number Height
cdraw.DrawSimpleBlurBox(x, y, w, h, color, blurAmt)
client gamemodes/catwork/gamemode/core/libraries/cl_clouddraw.lua:130Draws a box that blurs what is behind it.
Must be called from a panel's Paint: the colored box is drawn at the panel's
origin and x, y are the panel's screen position, used to line up the blur.
Parameters
- x Number Horizontal screen position of the panel
- y Number Vertical screen position of the panel
- w Number Width
- h Number Height
- color Color Color of the box drawn under the blur
- blurAmt Number optional, defaults to
4Strength of the blur
See also
cdraw.DrawText(text, x, y, size, color, font)
client gamemodes/catwork/gamemode/core/libraries/cl_clouddraw.lua:111Draws text with one of the sized fonts created by this library.
The font name is font followed by size, such as Derma24 or ExoBold16;
sizes 1 to 72 exist for Derma, DermaNarrow, DermaNarrowBold, Exo,
ExoBold, DermaBold, DermaThin and DermaGlow.
Parameters
- text String Text to draw
- x Number Horizontal position
- y Number Vertical position
- size Number Font size, from 1 to 72
- color Color Text color
- font String optional, defaults to
'Derma'Font family prefix
cdraw.PolyBar(x, y, w, h, pct, col)
client gamemodes/catwork/gamemode/core/libraries/cl_clouddraw.lua:260Draws a slanted progress bar with a dark background.
Parameters
- x Number Horizontal position
- y Number Vertical position
- w Number Width
- h Number Height
- pct Number Progress, from 0 to 100
- col Color Color of the filled part