UNPKG

diginext-pixi

Version:
1 lines 1.85 kB
"use strict";var _RotationIcon_instances,_RotationIcon_awake,__createBinding=this&&this.__createBinding||(Object.create?function(t,e,i,o){void 0===o&&(o=i);var r=Object.getOwnPropertyDescriptor(e,i);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,o,r)}:function(t,e,i,o){void 0===o&&(o=i),t[o]=e[i]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),__importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&__createBinding(e,t,i);return __setModuleDefault(e,t),e},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)};Object.defineProperty(exports,"__esModule",{value:!0});const pixi_js_1=require("pixi.js"),PIXI=__importStar(require("pixi.js"));class RotationIcon extends pixi_js_1.Container{constructor(t){super(),_RotationIcon_instances.add(this),this.color=t.color||16777215,this.core=t.core,this.pos=t.pos,__classPrivateFieldGet(this,_RotationIcon_instances,"m",_RotationIcon_awake).call(this)}}exports.default=RotationIcon,_RotationIcon_instances=new WeakSet,_RotationIcon_awake=function(){this.core||(this.core=new PIXI.Graphics,this.core.lineStyle({width:2,color:this.color}),this.core.beginFill(16777215,1),this.core.drawCircle(0,0,10),this.core.endFill());const{pos:t}=this;this.x=t.x,this.y=t.y,this.addChild(this.core)};