Skip to content

Line Width

The lineWidth defines the width of drawing line for stroke function.

ParameterDescription
numberThe width of the current line, in pixels.

Example

ts
const ctx = node.getComponent(Graphics);
ctx.lineWidth = 20;
ctx.rect(20,20,80,100);
ctx.stroke();

lineWidth.png


Return to the Graphics Component Reference documentation.