import { TransformerPointRender } from './TransformerPointRender'; export class TransformerAnchorRender extends TransformerPointRender { private _angle: number; private _angleIndicato: egret.Sprite; constructor() { super(-1); this.onIndicato(); } get angle() { return this._angle; } set angle(value: number) { if (this._angle != value) { this._angle = value; } } protected onIndicato() { this._angleIndicato = new egret.Sprite(); this._angleIndicato.graphics.beginFill(0xff8000, 1); this._angleIndicato.graphics.drawCircle(0, 0, 10); this._angleIndicato.graphics.drawCircle(0, 0, 6); this._angleIndicato.graphics.endFill(); this._angleIndicato.graphics.lineStyle(1, 0xff8000); this._angleIndicato.graphics.beginFill(0xff8000, 1); this._angleIndicato.graphics.moveTo(12, -4); this._angleIndicato.graphics.lineTo(18, 0); this._angleIndicato.graphics.lineTo(12, 4); this._angleIndicato.graphics.lineTo(12, -4); this._angleIndicato.graphics.endFill(); this.addChild(this._angleIndicato); } protected onRender() { this.rotation = 0; this.rotation = this.angle; this.graphics.clear(); this.graphics.beginFill(0, 0.01); this.graphics.drawCircle(0, 0, 12); this.graphics.endFill(); } }