Skip to main content

Rect

Rectangle component.

Properties

width

width: SimpleSignal<number, this>;

Width.

height

height: SimpleSignal<number, this>;

Height.

cornerRadius

cornerRadius: SimpleSignal<number, this>;

Corner radius.

cornerSharpness

cornerSharpness: SimpleSignal<number, this>;

Corner sharpness.

smoothCorners

smoothCorners: SimpleSignal<boolean, this>;

Smooth corners.

Examples

import {Rect} from '@wangyaoshen/locus';

const rect = new Rect({
width: 200,
height: 100,
position: new Vector2(0, 0),
fill: 'blue',
cornerRadius: 10,
});