Skip to content

types.rect_drawable

A drawable rectangle

Functions

new(): types.rect_drawable

Creates a new rect drawable

position(x : number, y : number): types.rect_drawable

Sets the position

  • x (number) The x position
  • y (number) The y position
  • returns (types.rect_drawable) The rect drawable instance

bounds(width : number, height : number): types.rect_drawable

Sets the bounds

  • width (number) The width
  • height (number) The height
  • returns (types.rect_drawable) The rect drawable instance

base_color(color : types.color): types.rect_drawable

Sets the base color

grad_color(color : types.color): types.rect_drawable

Sets the gradient color

gradient_mode(mode : enums.gradient_mode): types.rect_drawable

Sets the gradient mode

corner_radii(all : number): types.rect_drawable

Sets the corner radii

  • all (number) The radius for all corners (when using 1 argument)
  • tl (number) The top-left radius (when using 4 arguments)
  • tr (number) The top-right radius (when using 4 arguments)
  • bl (number) The bottom-left radius (when using 4 arguments)
  • br (number) The bottom-right radius (when using 4 arguments)
  • returns (types.rect_drawable) The rect drawable instance

outline(thickness : number, color : types.color): types.rect_drawable

Sets the outline

texture(texture : types.texture): types.rect_drawable

Sets the texture

blur(opacity : number): types.rect_drawable

Sets the blur

  • opacity (number) The blur opacity (0.0 to 1.0)
  • returns (types.rect_drawable) The rect drawable instance

insert(canvas : types.ui_canvas)

Inserts the drawable into a canvas