Skip to content

Rect

you can create a Rect such like the red one with less code:

<canvas id="canvas"></canvas>
1
const engine = new CanvasEngine({
  w: "200",
  h: "200"
})
const rect = new Rect({
  x: 10,
  y: 10,
  w: 100,
  h: 100,
  zIndex: 0
})
engine.render(rect, {
  color: '#dd6d50'
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14