import { _decorator, Component, Graphics, Node } from 'cc'; const { ccclass, property } = _decorator; @ccclass('test') export class test extends Component { @property(Graphics) m_g:Graphics = null start() { // const g = this.m_g // g.lineWidth = 10; // g.fillColor.fromHEX('#ff0000'); // g.moveTo(-40, 0); // g.lineTo(0, -80); // g.lineTo(40, 0); // g.lineTo(0, 80); // g.close(); // g.stroke(); // this.m_g.fill(); const ctx = this.m_g ctx.moveTo(20,20); ctx.lineWidth = 30; ctx.fillColor.fromHEX('#ff0000'); ctx.bezierCurveTo(20,100,200,100,200,20); // ctx.close(); ctx.stroke(); // ctx.fill(); } update(deltaTime: number) { } }