/c

canvas 2d render

Primary LanguageTypeScript

C

What

canvas 2d render

Class

Scene

const scene = new c.Scene({
  width: 800,
  height: 800,
});

Group

const group = new c.Group();

Shape

Rect

const rect = new c.Rect({
  width: 5,
  height: 5,
  lineWidth: 3,
  strokeStyle: color(),
  cursor: 'pointer',
});

API

translate(tx,tx)

rect.translate(30, 30);

moveTo(targetX,targetY)

rect.moveTo(30, 30);

scale(sx,sy)

rect.scale(30, 30);

rotate(radian)

rect.rotate(30);