Canvas:SetShape

Sets the canvas shape. Must have at least one of "fill" or "stroke".

Usage:

Canvas:SetShape(path, fill, stroke)
ParameterTypeDatatypeDescription
fillparametertable, nilA fill style. By default, "gradientLinear" spreads on the X axis, between 0 and 100. "gradientRadial" is centered around the local origin, with a radius of 100 units. "texture" starts at the origin and extends out to the texture size. Members:
type: One of "solid", "gradientLinear", "gradientRadial", "texture". Required.
r: Red color value, betwen 0 and 1. Available and required for "solid".
g: Green color value, betwen 0 and 1. Available and required for "solid".
b: Blue color value, betwen 0 and 1. Available and required for "solid".
a: Alpha color value, betwen 0 and 1. Defaults to 1. Available for "solid".
color: Gradient color values. A table containing a series of tables, with consecutive integer keys starting from 1. Each internal table contains color values and a gradient position. Available and required for "gradientLinear" and "gradientRadial". Members:
r: Red color value, between 0 and 1. Required.
g: Green color value, between 0 and 1. Required.
b: Blue color value, between 0 and 1. Required.
a: Alpha color value, between 0 and 1. Defaults to 1.
position: Location within the gradient. Must be nondecreasing. Gradient automatically rescales to fit the largest position value seen.
transform: An array containing the first two rows of a 3x3 transformation matrix. The third row is set to (0,0,1). Defaults to {1, 0, 0, 0, 1, 0}, representing the identity matrix. See Utility.Matrix.Create() for basic functionality. Available for "gradientLinear", "gradientRadial", and "texture".
focus: Number between 0 and 1 controlling the center bias of radial gradients. Defaults to 0. Available for "gradientRadial".
wrap: Control the bounds behavior of textures. Must be either "clamp" or "repeat". Defaults to "clamp". Available for "texture".
smooth: Boolean controlling texture smoothing behavior. Defaults to true. Available for "texture".
source: Source addon ID of the texture to be rendered. See Texture:SetTexture() for details. Available and required for "texture".
texture: Texture identifier of the texture to be rendered. See Texture:SetTexture() for details. Available and required for "texture".
pathparametertable, nilA path. Consists of a table containing a series of tables, with consecutive integer keys starting from 1. Each internal table contains coordinates, either as an absolute value relative to the top-left corner of the frame, or Proportional to the frame size, as a number from 0 to 1. Giving both an absolute value and a proportional value for any coordinate is not allowed. Members:
x/xProportional: x coordinate of this point. Required.
y/yProportional: y coordinate of this point. Required.
xControl/xControlProportional: x coordinate of the curve control handle. If this exists, yControl/yControlProportional must also exist.
yControl/yControlProportional: y coordinate of the curve control handle. If this exists, xControl/xControlProportional must also exist.
strokeparametertable, nilA stroke style. Members:
r: Red color value, betwen 0 and 1. Required.
g: Green color value, betwen 0 and 1. Required.
b: Blue color value, betwen 0 and 1. Required.
a: Alpha color value, betwen 0 and 1. Defaults to 1.
cap: Endcap behavior for non-loops. May be "none", "square", or "round". Defaults to "round".
miter: Corner behavior. May be "miter", "round", or "bevel". Defaults to "miter".
miterLimit: Determines how small the corner angle can be until the miter is chopped off. Defaults to 3. Available only if miter behavior is set to "miter".
thickness: Line thickness. Required.