text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rexlineplugin=e():t.rexlineplugin=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=248)}({248:function(t,e,n){"use strict";n.r(e);var i=n(82),r=Phaser.Math.Distance.Between,o=Phaser.Math.Angle.Between,s=function(){if(!this.redraw)return this;this.redraw=!1,this.clear();var t,e,n=this.lineStartFrame,s=this.lineEndFrame,u=this.lineBodyFrame,a=0,c=r(this.x0,this.y0,this.x1,this.y1),f=0,l=o(this.x0,this.y0,this.x1,this.y1);if(n&&(c+=a=this.lineStartOrigin*n.cutWidth,f=n.cutHeight),s&&(c+=(1-this.lineEndOrigin)*s.cutWidth,f=Math.max(f,s.cutHeight)),u){var h=void 0!==this.lineBodyWidth?this.lineBodyWidth:u.cutHeight;f=Math.max(f,h)}if(c=Math.floor(c),f=Math.floor(f),c<=0||f<=0)return this.setPosition(this.x0,this.y0).setSize(1,1).setRotation(l),this;this.setPosition(this.x0,this.y0).setSize(c,f).setRotation(l).setOrigin(0,0);var d,y=this.width;n&&(t=0,e=(this.height-n.cutHeight)/2,this.drawFrame(this.lineStartTexture,this.lineStartFrameName,t,e),y-=n.cutWidth),s&&(t=this.width-s.cutWidth,e=(this.height-s.cutHeight)/2,this.drawFrame(this.lineEndTexture,this.lineEndFrameName,t,e),y-=s.cutWidth),u&&y>0&&h>0&&(0===this.lineBodyExtendMode?(d=Object(i.a)(this,"_image","image")).setTexture(this.lineBodyTexture,this.lineBodyFrameName).setDisplaySize(y,h):(d=Object(i.a)(this,"_tileSprite","tileSprite")).setTexture(this.lineBodyTexture,this.lineBodyFrameName).setSize(y,h),t=n?n.cutWidth:0,e=(this.height-d.displayHeight)/2,this.draw(d,t,e));var p=1-(c-a)/c;this.setOrigin(p,.5)};function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function c(t,e){return!e||"object"!==u(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(t,e,n){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var d=Phaser.GameObjects.RenderTexture,y=Phaser.Utils.Objects.GetValue,p=function(t){function e(t,n){var i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=c(this,l(e).call(this,t))).redraw=!1,i._tileSprite=void 0,i._image=void 0;var r=y(n,"start",void 0);"string"==typeof r?(i.setLineStartPosition(0,0),i.setLineStartTexture(r,void 0),i.setLineStartOrigin(void 0)):(i.setLineStartPosition(y(r,"x",0),y(r,"y",0)),i.setLineStartTexture(y(r,"key",void 0),y(r,"frame",void 0)),i.setLineStartOrigin(y(r,"origin",void 0)));var o=y(n,"end",void 0);"string"==typeof o?(i.setLineEndPosition(0,0),i.setLineEndTexture(o,void 0),i.setLineEndOrigin(void 0)):(i.setLineEndPosition(y(o,"x",0),y(o,"y",0)),i.setLineEndTexture(y(o,"key",void 0),y(o,"frame",void 0)),i.setLineEndOrigin(y(o,"origin",void 0)));var s=y(n,"body",void 0);return"string"==typeof s?(i.setLineBodyTexture(s,void 0),i.setLineBodyExtendMode(0),i.setLineBodyWidth(void 0)):(i.setLineBodyTexture(y(s,"key",void 0),y(s,"frame",void 0)),i.setLineBodyExtendMode(y(s,"extendMode",1)),i.setLineBodyWidth(y(s,"width",void 0))),i}var n,i,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(e,d),n=e,(i=[{key:"setLineStartPosition",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"setLineEndPosition",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"setLineStartTexture",value:function(t,e){return this.lineStartTexture=t,this.lineStartFrameName=e,this.redraw=!0,this}},{key:"setLineStartOrigin",value:function(t){return void 0===t&&(t=0),this.lineStartOrigin=t,this.redraw=!0,this}},{key:"setLineEndTexture",value:function(t,e){return this.lineEndTexture=t,this.lineEndFrameName=e,this.redraw=!0,this}},{key:"setLineEndOrigin",value:function(t){return void 0===t&&(t=1),this.lineEndOrigin=t,this.redraw=!0,this}},{key:"setLineBodyTexture",value:function(t,e){return this.lineBodyTexture=t,this.lineBodyFrameName=e,this.redraw=!0,this}},{key:"setLineBodyWidth",value:function(t){return this.lineBodyWidth=t,this.redraw=!0,this}},{key:"setLineBodyExtendMode",value:function(t){return"string"==typeof t&&(t=b[t]),this.lineBodyExtendMode=t,this}},{key:"renderWebGL",value:function(t,n,i,r,o){this.updateTexture(),f(l(e.prototype),"renderWebGL",this).call(this,t,n,i,r,o)}},{key:"renderCanvas",value:function(t,n,i,r,o){this.updateTexture(),f(l(e.prototype),"renderCanvas",this).call(this,t,n,i,r,o)}},{key:"x0",get:function(){return this._x0},set:function(t){this.redraw|=this._x0!==t,this._x0=t}},{key:"y0",get:function(){return this._y0},set:function(t){this.redraw|=this._y0!==t,this._y0=t}},{key:"x1",get:function(){return this._x1},set:function(t){this.redraw|=this._x1!==t,this._x1=t}},{key:"y1",get:function(){return this._y1},set:function(t){this.redraw|=this._y1!==t,this._y1=t}},{key:"lineStartFrame",get:function(){return this.scene.textures.getFrame(this.lineStartTexture,this.lineStartFrameName)}},{key:"lineEndFrame",get:function(){return this.scene.textures.getFrame(this.lineEndTexture,this.lineEndFrameName)}},{key:"lineBodyFrame",get:function(){return this.scene.textures.getFrame(this.lineBodyTexture,this.lineBodyFrameName)}}])&&a(n.prototype,i),r&&a(n,r),e}(),b={scale:0,repeat:1},v={updateTexture:s};Object.assign(p.prototype,v);var m=p,g=function(t){var e=new m(this.scene,t);return this.scene.add.existing(e),e},x=Phaser.GameObjects.BuildGameObject,O=function(t,e){void 0!==e&&(t.add=e);var n=new m(this.scene,t);return x(this.scene,n,t),n},S=n(5);function w(t){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _(t,e){return!e||"object"!==w(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function P(t){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function L(t,e){return(L=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var T=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=_(this,P(e).call(this,t)),t.registerGameObject("rexLine",g,O),n}var n,i,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&L(t,e)}(e,Phaser.Plugins.BasePlugin),n=e,(i=[{key:"start",value:function(){this.game.events.on("destroy",this.destroy,this)}}])&&j(n.prototype,i),r&&j(n,r),e}();Object(S.a)(window,"RexPlugins.GameObjects.Line",m);e.default=T},5:function(t,e,n){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r=function(t){return null==t||""===t||0===t.length};e.a=function(t,e,n){if("object"===i(t)){if(r(e)){if(null==n)return;"object"===i(n)&&(t=n)}else{"string"==typeof e&&(e=e.split("."));var o=e.pop();((function(t,e,n){var o=t;if(r(e));else{var s;"string"==typeof e&&(e=e.split("."));for(var u=0,a=e.length;u<a;u++){var c;null!=o[s=e[u]]&&"object"===i(o[s])||(c=u===a-1?void 0===n?{}:n:{},o[s]=c),o=o[s]}}return o})(t,e))[o]=n}return t}}},82:function(t,e,n){"use strict";e.a=function(t,e,n){return void 0===n&&(n="image"),t[e]||(t[e]=t.scene.make[n]({add:!1,origin:{x:0,y:0}}),t.on("destroy",function(){t[e]&&(t[e].destroy(),t[e]=void 0)})),t[e]}}}).default});