UNPKG

@turbox3d/graphic-component-pixi

Version:

Graphic component library based on pixi

49 lines 2.06 kB
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; import _createClass from "@babel/runtime/helpers/esm/createClass"; import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; import _inherits from "@babel/runtime/helpers/esm/inherits"; function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } import { Mesh2D } from '@turbox3d/renderer-pixi'; import * as PIXI from 'pixi.js'; var Placement = /*#__PURE__*/function (_Mesh2D) { function Placement() { var _this; _classCallCheck(this, Placement); _this = _callSuper(this, Placement, arguments); _this.view = new PIXI.Graphics(); _this.reactivePipeLine = [_this.updateGeometry, _this.updateMaterial, _this.updatePosition, _this.updateRotation, _this.updateScale]; return _this; } _inherits(Placement, _Mesh2D); return _createClass(Placement, [{ key: "updateGeometry", value: function updateGeometry() { this.view.clear(); } }, { key: "updateMaterial", value: function updateMaterial() { // } }, { key: "updatePosition", value: function updatePosition() { // const { position } = this.props; // this.view.position.set(position!.x, position!.y); } }, { key: "updateRotation", value: function updateRotation() { // this.view.rotation = this.props.rotation!; } }, { key: "updateScale", value: function updateScale() { // const { scale } = this.props; // this.view.scale.set(scale!.x, scale!.y); } }]); }(Mesh2D); export { Placement as default };