New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

phavuer

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phavuer - npm Package Compare versions

Comparing version 0.8.3 to 0.8.4

2

dist/phavuer.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Vue")):"function"==typeof define&&define.amd?define(["Vue"],t):"object"==typeof exports?exports.Phavuer=t(require("Vue")):e.Phavuer=t(e.Vue)}(this,(function(e){return(()=>{"use strict";var t={207:(e,t,i)=>{i.r(t),i.d(t,{Body:()=>x,Circle:()=>p,Container:()=>h,Image:()=>u,Light:()=>w,Line:()=>g,Rectangle:()=>d,RoundRectangle:()=>c,Scene:()=>a,Sprite:()=>y,StaticBody:()=>b,Text:()=>f,TilemapLayer:()=>m,Zone:()=>v,createPhavuerApp:()=>Y,initGameObject:()=>X,onPostUpdate:()=>C,onPreUpdate:()=>B,refObj:()=>O,refScene:()=>j,refTo:()=>k});var n=i(5);const s=["pointerdown","pointermove","pointerup","pointerout","wheel"],r=e=>{e.updateDisplayOrigin&&e.updateDisplayOrigin(),e.input?e.input.hitArea.setSize(e.width,e.height):e._events&&s.some((t=>t in e._events))&&e.setInteractive()},o=["tween","tweens","timeline","style"],l={active:e=>t=>e.setActive(t),visible:e=>t=>e.setVisible(t),x:e=>t=>e.setPosition(t,e.y),y:e=>t=>e.setPosition(e.x,t),x1:e=>t=>e.x1=t,y1:e=>t=>e.y1=t,x2:e=>t=>e.x2=t,y2:e=>t=>e.y2=t,rotation:e=>t=>e.setRotation(t),origin:e=>t=>e.setOrigin(t,t),originX:e=>t=>e.setOrigin(t,e.originY),originY:e=>t=>e.setOrigin(e.originX,t),scale:e=>t=>e.setScale(t,t),scaleX:e=>t=>e.setScale(t,e.scaleY),scaleY:e=>t=>e.setScale(e.scaleX,t),width:e=>t=>{e.setSize(t,e.height),r(e)},height:e=>t=>{e.setSize(e.width,t),r(e)},radius:e=>t=>e.setRadius(t),displayWidth:e=>t=>e.setDisplaySize(t,e.displayHeight),displayHeight:e=>t=>e.setDisplaySize(e.displayWidth,t),displayOriginX:e=>t=>e.setDisplayOrigin(t,e.displayOriginY),displayOriginY:e=>t=>e.setDisplayOrigin(e.displayOriginX,t),flipX:e=>t=>e.setFlipX(t),flipY:e=>t=>e.setFlipY(t),depth:e=>t=>e.setDepth(t),alpha:e=>t=>e.setAlpha(t),blendMode:e=>t=>e.setBlendMode(t),pipeline:e=>t=>e.setPipeline(t),intensity:e=>t=>e.setIntensity(t),tint:e=>t=>e.setTint(t),text:e=>t=>e.setText(t),texture:e=>t=>e.setTexture(t,e.frame&&e.frame.name),frame:e=>t=>e.setFrame(t),color:e=>t=>e.setColor(t),fillColor:e=>t=>e.setFillStyle(t,e.fillAlpha),fillAlpha:e=>t=>e.setFillStyle(e.fillColor,t),lineWidth:e=>(t,i)=>{e.setLineWidth?e.setLineWidth(t,i):e.setStrokeStyle(...t?[t,e.strokeColor,e.strokeAlpha]:[])},strokeColor:e=>t=>e.setStrokeStyle(e.lineWidth,t,e.strokeAlpha),strokeAlpha:e=>t=>e.setStrokeStyle(e.lineWidth,e.strokeColor,t),style:e=>t=>e.setStyle(t),lineSpacing:e=>t=>e.setLineSpacing(t),padding:e=>t=>e.setPadding(t),collision:e=>t=>e.setCollision(t),collisionByProperty:e=>t=>e.setCollisionByProperty(t),enable:e=>t=>e.enable=t,immovable:e=>t=>e.setImmovable(t),moves:e=>t=>e.moves=t,bounceX:e=>t=>e.setBounceX(t),bounceY:e=>t=>e.setBounceY(t),drag:e=>t=>e.setDrag(t),dragX:e=>t=>e.setDragX(t),dragY:e=>t=>e.setDragY(t),gravityX:e=>t=>e.setGravityX(t),gravityY:e=>t=>e.setGravityY(t),frictionX:e=>t=>e.setFrictionX(t),frictionY:e=>t=>e.setFrictionY(t),velocityX:e=>t=>e.setVelocityX(t),velocityY:e=>t=>e.setVelocityY(t),maxVelocityX:e=>t=>e.setMaxVelocityX(t),maxVelocityY:e=>t=>e.setMaxVelocityY(t),accelerationX:e=>t=>e.setAccelerationX(t),accelerationY:e=>t=>e.setAccelerationY(t),offsetX:e=>t=>e.setOffset(t,e.offset.y),offsetY:e=>t=>e.setOffset(e.offset.x,t),tween:e=>t=>{e.tween&&e.tween.stop(),t&&(e.tween=e.scene.add.tween(Object.assign({targets:e},t)))},tweens:e=>t=>{e.tween&&e.tween.stop(),t&&(e.tween=e.scene.tweens.timeline({targets:e,tweens:t}))},timeline:e=>t=>{e.tween&&e.tween.stop(),t&&(e.tween=e.scene.tweens.timeline(Object.assign({targets:e},t)))}},a={props:{name:{type:String,require:!0},autoStart:{type:Boolean,default:!0}},setup(e,t){const i=(0,n.ref)(!0),s=[],r=[],o=class extends Phaser.Scene{init(e){i.value=!0,t.emit("init",this,e)}create(e){t.emit("create",this,e)}update(e,i){s.forEach((t=>t(e,i))),t.emit("update",this,e,i),r.forEach((t=>t(e,i)))}preload(){t.emit("preload",this)}},l=(0,n.inject)("game").scene.add(e.name,o,e.autoStart);return l.events.on("shutdown",(()=>i.value=!1)),(0,n.provide)("scene",l),(0,n.provide)("preUpdateEvents",s),(0,n.provide)("postUpdateEvents",r),{scene:l,show:i}},render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[s.show?(0,n.renderSlot)(e.$slots,"default",{key:0}):(0,n.createCommentVNode)("v-if",!0)])}},h={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Container(i,e.x||0,e.y||0);return X(s,e,t),(0,n.provide)("container",s),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","width","height","rotation","x","y","depth","alpha","blendMode","pipeline"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},d={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Rectangle(i,e.x||0,e.y||0,e.width,e.height);return X(s,e,t),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","x","y","rotation","width","height","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","fillColor","fillAlpha","lineWidth","strokeColor","strokeAlpha"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},c={setup(e,t){const i=(0,n.inject)("scene");class s extends Phaser.GameObjects.Graphics{constructor(e,t,i,n,s,r){super(e,t,i,n,s),this._originX=0,this._originY=0,this._width=n||0,this._height=s||0,this._radius=r||0,this._fillColor=null,this._fillAlpha=1,this._lineWidth=0,this._strokeColor=null,this._strokeAlpha=1,this.setRenderFlag(!0)}preUpdate(...e){this.renderFlag&&this.render()}setRenderFlag(e){this.renderFlag=e}render(){this.setRenderFlag(!1);const e=this.originX*-this.width,t=this.originY*-this.height,i="number"==typeof this.radius?Math.min(this.radius,this.width.half,this.height.half):this.radius;this.clear(),null!==this.fillColor&&(this.fillStyle(this.fillColor,this.fillAlpha),this.fillRoundedRect(e,t,this.width,this.height,i)),this.lineWidth&&null!==this.strokeColor&&(this.lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha),this.strokeRoundedRect(e,t,this.width,this.height,i))}get originX(){return this._originX}set originX(e){this._originX=e,this.displayOriginX=this.width*e,this.setRenderFlag(!0)}get originY(){return this._originY}set originY(e){this._originY=e,this.displayOriginY=this.height*e,this.setRenderFlag(!0)}setOrigin(e,t){return this.originX=e,this.originY=void 0===t?e:t,this}get radius(){return this._radius}set radius(e){return this._radius=e}setRadius(e){return this.radius=e,this}get width(){return this._width}set width(e){this._width=e,this.fixSize(),this.setRenderFlag(!0)}get height(){return this._height}set height(e){this._height=e,this.fixSize(),this.setRenderFlag(!0)}setSize(e,t){return void 0!==e&&(this.width=e),void 0!==t&&(this.height=t),this}fixSize(){this.input&&this.input.hitArea.setSize(this.width,this.height),this.body&&this.body.setSize(this.width,this.height)}get displayWidth(){return Math.abs(this.scaleX*this.width)}set displayWidth(e){this.scaleX=e/this.width}get displayHeight(){return Math.abs(this.scaleY*this.height)}set displayHeight(e){this.scaleY=e/this.height}get fillColor(){return this._fillColor}set fillColor(e){this._fillColor=e,this.setRenderFlag(!0)}get fillAlpha(){return this._fillAlpha}set fillAlpha(e){this._fillAlpha=e,this.setRenderFlag(!0)}setFillStyle(e,t){return void 0!==e&&(this.fillColor=e),void 0!==t&&(this.fillAlpha=t),this}get lineWidth(){return this._lineWidth}set lineWidth(e){this._lineWidth=e,this.setRenderFlag(!0)}get strokeColor(){return this._strokeColor}set strokeColor(e){this._strokeColor=e,this.setRenderFlag(!0)}get strokeAlpha(){return this._strokeAlpha}set strokeAlpha(e){this._strokeAlpha=e,this.setRenderFlag(!0)}setStrokeStyle(e,t,i){return void 0!==e&&(this.lineWidth=e),void 0!==t&&(this.strokeColor=t),void 0!==i&&(this.strokeAlpha=i),this}}const r=new s(i,e.x||0,e.y||0,e.width,e.height,e.radius);return X(r,e,t),(0,n.provide)("gameObject",r),{object:r}},props:["tween","tweens","timeline","visible","x","y","rotation","width","height","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","fillColor","fillAlpha","lineWidth","strokeColor","strokeAlpha","radius"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},p={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Arc(i,e.x||0,e.y||0,e.radius);return X(s,e,t),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","x","y","rotation","radius","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","fillColor","fillAlpha","lineWidth","strokeColor","strokeAlpha"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},g={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Line(i,e.x||0,e.y||0,e.x1,e.y1,e.x2,e.y2);return X(s,e,t),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","x","y","x1","y1","x2","y2","rotation","width","height","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","lineWidth","strokeColor","strokeAlpha"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},u={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Image(i,e.x||0,e.y||0,e.texture);return X(s,e,t),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","x","y","rotation","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","texture","frame","tint","flipX","flipY"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},y={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Sprite(i,e.x||0,e.y||0,e.texture);return X(s,e,t),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","x","y","rotation","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","texture","frame","tint","flipX","flipY"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},f={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Text(i,e.x||0,e.y||0,e.text);return X(s,e,t),{object:s}},props:["tween","tweens","timeline","visible","text","rotation","x","y","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","style","lineSpacing","padding"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},m={props:["tween","tweens","timeline","visible","x","y","width","height","depth","pipeline","tilemap","layerIndex","tileset","collision","collisionByProperty"],setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.Tilemaps.TilemapLayer(i,e.tilemap,e.layerIndex,e.tileset,e.x||0,e.y||0);return X(s,e,t),{object:s}},render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},v={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Zone(i,e.x||0,e.y||0,e.width,e.height);return X(s,e,t),{object:s}},props:["tween","tweens","timeline","active","x","y","width","height","origin","originX","originY","displayOriginX","displayOriginY"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},w={setup(e,t){(0,n.inject)("scene");const i=new Phaser.GameObjects.Light(e.x||0,e.y||0);return X(i,e,t),{object:i}},props:["tween","tweens","timeline","visible","x","y","radius","color","intensity"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},b={setup(e,t){const i=(0,n.inject)("scene"),s=(0,n.inject)("gameObject"),r=i.physics.add.existing(s,Phaser.Physics.Arcade.STATIC_BODY).body;X(r,e,t)},props:["width","height","offsetX","offsetY","enable"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},x={setup(e,t){const i=(0,n.inject)("scene"),s=(0,n.inject)("gameObject"),r=i.physics.add.existing(s,Phaser.Physics.Arcade.DYNAMIC_BODY).body;X(r,e,t)},props:["width","height","offsetX","offsetY","enable","immovable","moves","bounceX","bounceY","drag","dragX","dragY","gravityX","gravityY","frictionX","frictionY","velocityX","velocityY","maxVelocityX","maxVelocityY","accelerationX","accelerationY"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},Y=(e,t)=>{t.provide("game",e),t.provide("scene",null),t.provide("container",null);const i=window.document.createElement("div");return document.body.appendChild(i),t.mount(i)},X=(e,t,i)=>{const s="bounce"in e,r=e.constructor===Phaser.GameObjects.Light,a=(0,n.inject)("scene");if(r)a.lights.active||a.lights.enable(),a.lights.lights.push(e);else if(s);else{a.add.existing(e);const t=(0,n.inject)("container");t&&t.add([e])}const h=Object.keys(t).map((i=>{if(!l[i])return;const s=l[i](e);return s(t[i]),(0,n.watch)((()=>t[i]),s,{deep:o.includes(i)})}));i.attrs.onCreate&&i.emit("create",e);const d=[{attr:"onPointerdown",emit:"pointerdown",eventIndex:3},{attr:"onPointermove",emit:"pointermove",eventIndex:3},{attr:"onPointerup",emit:"pointerup",eventIndex:3},{attr:"onPointerout",emit:"pointerout",eventIndex:1},{attr:"onWheel",emit:"wheel",eventIndex:4}].filter((e=>e.attr in i.attrs));return d.length&&(e.setInteractive(),d.forEach((t=>{e.on(t.emit,((...e)=>{e[0].stopPropagation=e[t.eventIndex].stopPropagation,i.emit(t.emit,...e)}))}))),(0,n.onBeforeUnmount)((()=>{e.tween&&e.tween.stop(),h.forEach((e=>e&&e()))})),r?(0,n.onBeforeUnmount)((()=>a.lights.removeLight(e))):(0,n.onBeforeUnmount)((()=>e.destroy())),e},k=(e,t)=>(0,n.customRef)(((i,n)=>({get:()=>(i(),e),set(i){e&&i||(e=i?i[t]:null,n())}}))),O=e=>k(e,"object"),j=e=>k(e,"scene"),S=e=>t=>{const i=(0,n.inject)(e);i.push(t),(0,n.onBeforeUnmount)((()=>{const e=i.findIndex((e=>e===t));i.splice(e,1)}))},B=S("preUpdateEvents"),C=S("postUpdateEvents")},5:t=>{t.exports=e}},i={};function n(e){if(i[e])return i[e].exports;var s=i[e]={exports:{}};return t[e](s,s.exports,n),s.exports}return n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(207)})()}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Vue")):"function"==typeof define&&define.amd?define(["Vue"],t):"object"==typeof exports?exports.Phavuer=t(require("Vue")):e.Phavuer=t(e.Vue)}(this,(function(e){return(()=>{"use strict";var t={207:(e,t,i)=>{i.r(t),i.d(t,{Body:()=>x,Circle:()=>p,Container:()=>h,Image:()=>u,Light:()=>w,Line:()=>g,Rectangle:()=>d,RoundRectangle:()=>c,Scene:()=>a,Sprite:()=>y,StaticBody:()=>b,Text:()=>f,TilemapLayer:()=>m,Zone:()=>v,createPhavuerApp:()=>Y,initGameObject:()=>X,onPostUpdate:()=>C,onPreUpdate:()=>B,refObj:()=>j,refScene:()=>k,refTo:()=>O});var n=i(5);const s=["pointerdown","pointermove","pointerup","pointerout","wheel"],r=e=>{e.updateDisplayOrigin&&e.updateDisplayOrigin(),e.input?e.input.hitArea.setSize(e.width,e.height):e._events&&s.some((t=>t in e._events))&&e.setInteractive()},o=["tween","tweens","timeline","style"],l={active:e=>t=>e.setActive(t),visible:e=>t=>e.setVisible(t),x:e=>t=>e.setPosition(t,e.y),y:e=>t=>e.setPosition(e.x,t),x1:e=>t=>e.x1=t,y1:e=>t=>e.y1=t,x2:e=>t=>e.x2=t,y2:e=>t=>e.y2=t,rotation:e=>t=>e.setRotation(t),origin:e=>t=>e.setOrigin(t,t),originX:e=>t=>e.setOrigin(t,e.originY),originY:e=>t=>e.setOrigin(e.originX,t),scale:e=>t=>e.setScale(t,t),scaleX:e=>t=>e.setScale(t,e.scaleY),scaleY:e=>t=>e.setScale(e.scaleX,t),width:e=>t=>{e.setSize(t,e.height),r(e)},height:e=>t=>{e.setSize(e.width,t),r(e)},radius:e=>t=>e.setRadius(t),displayWidth:e=>t=>e.setDisplaySize(t,e.displayHeight),displayHeight:e=>t=>e.setDisplaySize(e.displayWidth,t),displayOriginX:e=>t=>e.setDisplayOrigin(t,e.displayOriginY),displayOriginY:e=>t=>e.setDisplayOrigin(e.displayOriginX,t),flipX:e=>t=>e.setFlipX(t),flipY:e=>t=>e.setFlipY(t),depth:e=>t=>e.setDepth(t),alpha:e=>t=>e.setAlpha(t),blendMode:e=>t=>e.setBlendMode(t),pipeline:e=>t=>e.setPipeline(t),intensity:e=>t=>e.setIntensity(t),tint:e=>t=>e.setTint(t),text:e=>t=>e.setText(t),texture:e=>t=>e.setTexture(t,e.frame&&e.frame.name),frame:e=>t=>e.setFrame(t),color:e=>t=>e.setColor(t),fillColor:e=>t=>e.setFillStyle(t,e.fillAlpha),fillAlpha:e=>t=>e.setFillStyle(e.fillColor,t),lineWidth:e=>(t,i)=>{e.setLineWidth?e.setLineWidth(t,i):e.setStrokeStyle(...t?[t,e.strokeColor,e.strokeAlpha]:[])},strokeColor:e=>t=>e.setStrokeStyle(e.lineWidth,t,e.strokeAlpha),strokeAlpha:e=>t=>e.setStrokeStyle(e.lineWidth,e.strokeColor,t),style:e=>t=>e.setStyle(t),lineSpacing:e=>t=>e.setLineSpacing(t),padding:e=>t=>e.setPadding(t),collision:e=>t=>e.setCollision(t),collisionByProperty:e=>t=>e.setCollisionByProperty(t),enable:e=>t=>e.enable=t,immovable:e=>t=>e.setImmovable(t),moves:e=>t=>e.moves=t,bounceX:e=>t=>e.setBounceX(t),bounceY:e=>t=>e.setBounceY(t),drag:e=>t=>e.setDrag(t),dragX:e=>t=>e.setDragX(t),dragY:e=>t=>e.setDragY(t),gravityX:e=>t=>e.setGravityX(t),gravityY:e=>t=>e.setGravityY(t),frictionX:e=>t=>e.setFrictionX(t),frictionY:e=>t=>e.setFrictionY(t),velocityX:e=>t=>e.setVelocityX(t),velocityY:e=>t=>e.setVelocityY(t),maxVelocityX:e=>t=>e.setMaxVelocityX(t),maxVelocityY:e=>t=>e.setMaxVelocityY(t),accelerationX:e=>t=>e.setAccelerationX(t),accelerationY:e=>t=>e.setAccelerationY(t),offsetX:e=>t=>e.setOffset(t,e.offset.y),offsetY:e=>t=>e.setOffset(e.offset.x,t),tween:e=>t=>{e.tween&&e.tween.stop(),t&&(e.tween=e.scene.add.tween(Object.assign({targets:e},t)))},tweens:e=>t=>{e.tween&&e.tween.stop(),t&&(e.tween=e.scene.tweens.timeline({targets:e,tweens:t}))},timeline:e=>t=>{e.tween&&e.tween.stop(),t&&(e.tween=e.scene.tweens.timeline(Object.assign({targets:e},t)))}},a={props:{name:{type:String,require:!0},autoStart:{type:Boolean,default:!0}},setup(e,t){const i=(0,n.ref)(!0),s=[],r=[],o=class extends Phaser.Scene{init(e){i.value=!0,t.emit("init",this,e)}create(e){t.emit("create",this,e)}update(e,i){s.forEach((t=>t(e,i))),t.emit("update",this,e,i),r.forEach((t=>t(e,i)))}preload(){t.emit("preload",this)}},l=(0,n.inject)("game").scene.add(e.name,o,e.autoStart);return l.events.on("shutdown",(()=>i.value=!1)),(0,n.provide)("scene",l),(0,n.provide)("preUpdateEvents",s),(0,n.provide)("postUpdateEvents",r),{scene:l,show:i}},render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[s.show?(0,n.renderSlot)(e.$slots,"default",{key:0}):(0,n.createCommentVNode)("v-if",!0)])}},h={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Container(i,e.x||0,e.y||0);return X(s,e,t),(0,n.provide)("container",s),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","width","height","rotation","x","y","depth","alpha","blendMode","pipeline"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},d={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Rectangle(i,e.x||0,e.y||0,e.width,e.height);return X(s,e,t),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","x","y","rotation","width","height","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","fillColor","fillAlpha","lineWidth","strokeColor","strokeAlpha"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},c={setup(e,t){const i=(0,n.inject)("scene");class s extends Phaser.GameObjects.Graphics{constructor(e,t,i,n,s,r){super(e,t,i,n,s),this._originX=0,this._originY=0,this._width=n||0,this._height=s||0,this._radius=r||0,this._fillColor=null,this._fillAlpha=1,this._lineWidth=0,this._strokeColor=null,this._strokeAlpha=1,this.setRenderFlag(!0)}preUpdate(...e){this.renderFlag&&this.render()}setRenderFlag(e){this.renderFlag=e}render(){this.setRenderFlag(!1);const e=this.originX*-this.width,t=this.originY*-this.height,i="number"==typeof this.radius?Math.min(this.radius,this.width.half,this.height.half):this.radius;this.clear(),null!==this.fillColor&&(this.fillStyle(this.fillColor,this.fillAlpha),this.fillRoundedRect(e,t,this.width,this.height,i)),this.lineWidth&&null!==this.strokeColor&&(this.lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha),this.strokeRoundedRect(e,t,this.width,this.height,i))}get originX(){return this._originX}set originX(e){this._originX=e,this.displayOriginX=this.width*e,this.setRenderFlag(!0)}get originY(){return this._originY}set originY(e){this._originY=e,this.displayOriginY=this.height*e,this.setRenderFlag(!0)}setOrigin(e,t){return this.originX=e,this.originY=void 0===t?e:t,this}get radius(){return this._radius}set radius(e){return this._radius=e}setRadius(e){return this.radius=e,this}get width(){return this._width}set width(e){this._width=e,this.fixSize(),this.setRenderFlag(!0)}get height(){return this._height}set height(e){this._height=e,this.fixSize(),this.setRenderFlag(!0)}setSize(e,t){return void 0!==e&&(this.width=e),void 0!==t&&(this.height=t),this}fixSize(){this.input&&this.input.hitArea.setSize(this.width,this.height),this.body&&this.body.setSize(this.width,this.height)}get displayWidth(){return Math.abs(this.scaleX*this.width)}set displayWidth(e){this.scaleX=e/this.width}get displayHeight(){return Math.abs(this.scaleY*this.height)}set displayHeight(e){this.scaleY=e/this.height}get fillColor(){return this._fillColor}set fillColor(e){this._fillColor=e,this.setRenderFlag(!0)}get fillAlpha(){return this._fillAlpha}set fillAlpha(e){this._fillAlpha=e,this.setRenderFlag(!0)}setFillStyle(e,t){return void 0!==e&&(this.fillColor=e),void 0!==t&&(this.fillAlpha=t),this}get lineWidth(){return this._lineWidth}set lineWidth(e){this._lineWidth=e,this.setRenderFlag(!0)}get strokeColor(){return this._strokeColor}set strokeColor(e){this._strokeColor=e,this.setRenderFlag(!0)}get strokeAlpha(){return this._strokeAlpha}set strokeAlpha(e){this._strokeAlpha=e,this.setRenderFlag(!0)}setStrokeStyle(e,t,i){return void 0!==e&&(this.lineWidth=e),void 0!==t&&(this.strokeColor=t),void 0!==i&&(this.strokeAlpha=i),this}}const r=new s(i,e.x||0,e.y||0,e.width,e.height,e.radius);return X(r,e,t),(0,n.provide)("gameObject",r),{object:r}},props:["tween","tweens","timeline","visible","x","y","rotation","width","height","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","fillColor","fillAlpha","lineWidth","strokeColor","strokeAlpha","radius"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},p={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Arc(i,e.x||0,e.y||0,e.radius);return X(s,e,t),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","x","y","rotation","radius","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","fillColor","fillAlpha","lineWidth","strokeColor","strokeAlpha"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},g={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Line(i,e.x||0,e.y||0,e.x1,e.y1,e.x2,e.y2);return X(s,e,t),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","x","y","x1","y1","x2","y2","rotation","width","height","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","lineWidth","strokeColor","strokeAlpha"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},u={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Image(i,e.x||0,e.y||0,e.texture);return X(s,e,t),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","x","y","rotation","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","texture","frame","tint","flipX","flipY"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},y={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Sprite(i,e.x||0,e.y||0,e.texture);return X(s,e,t),(0,n.provide)("gameObject",s),{object:s}},props:["tween","tweens","timeline","visible","x","y","rotation","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","texture","frame","tint","flipX","flipY"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div",null,[(0,n.renderSlot)(e.$slots,"default")])}},f={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Text(i,e.x||0,e.y||0,e.text);return X(s,e,t),{object:s}},props:["tween","tweens","timeline","visible","text","rotation","x","y","origin","originX","originY","displayOriginX","displayOriginY","scale","scaleX","scaleY","displayWidth","displayHeight","depth","alpha","blendMode","pipeline","style","lineSpacing","padding"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},m={props:["tween","tweens","timeline","visible","x","y","width","height","depth","pipeline","tilemap","layerIndex","tileset","collision","collisionByProperty"],setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.Tilemaps.TilemapLayer(i,e.tilemap,e.layerIndex,e.tileset,e.x||0,e.y||0);return X(s,e,t),{object:s}},render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},v={setup(e,t){const i=(0,n.inject)("scene"),s=new Phaser.GameObjects.Zone(i,e.x||0,e.y||0,e.width,e.height);return X(s,e,t),{object:s}},props:["tween","tweens","timeline","active","x","y","width","height","origin","originX","originY","displayOriginX","displayOriginY"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},w={setup(e,t){(0,n.inject)("scene");const i=new Phaser.GameObjects.Light(e.x||0,e.y||0);return X(i,e,t),{object:i}},props:["tween","tweens","timeline","visible","x","y","radius","color","intensity"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},b={setup(e,t){const i=(0,n.inject)("scene"),s=(0,n.inject)("gameObject"),r=i.physics.add.existing(s,Phaser.Physics.Arcade.STATIC_BODY).body;X(r,e,t)},props:["width","height","offsetX","offsetY","enable"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},x={setup(e,t){const i=(0,n.inject)("scene"),s=(0,n.inject)("gameObject"),r=i.physics.add.existing(s,Phaser.Physics.Arcade.DYNAMIC_BODY).body;X(r,e,t)},props:["width","height","offsetX","offsetY","enable","immovable","moves","bounceX","bounceY","drag","dragX","dragY","gravityX","gravityY","frictionX","frictionY","velocityX","velocityY","maxVelocityX","maxVelocityY","accelerationX","accelerationY"],render:function(e,t,i,s,r,o){return(0,n.openBlock)(),(0,n.createBlock)("div")}},Y=(e,t)=>{t.provide("game",e),t.provide("scene",null),t.provide("container",null);const i=window.document.createElement("div");return document.body.appendChild(i),t.mount(i)},X=(e,t,i)=>{const s="bounce"in e,r=e.constructor===Phaser.GameObjects.Light,a=(0,n.inject)("scene");if(r)a.lights.active||a.lights.enable(),a.lights.lights.push(e);else if(s);else{a.add.existing(e);const t=(0,n.inject)("container");t&&t.add([e])}const h=Object.entries(t).map((([i,s])=>{if(void 0===s)return;if(!l[i])return;const r=l[i](e);return r(s),(0,n.watch)((()=>t[i]),r,{deep:o.includes(i)})}));i.attrs.onCreate&&i.emit("create",e);const d=[{attr:"onPointerdown",emit:"pointerdown",eventIndex:3},{attr:"onPointermove",emit:"pointermove",eventIndex:3},{attr:"onPointerup",emit:"pointerup",eventIndex:3},{attr:"onPointerout",emit:"pointerout",eventIndex:1},{attr:"onWheel",emit:"wheel",eventIndex:4}].filter((e=>e.attr in i.attrs));return d.length&&(e.setInteractive(),d.forEach((t=>{e.on(t.emit,((...e)=>{e[0].stopPropagation=e[t.eventIndex].stopPropagation,i.emit(t.emit,...e)}))}))),(0,n.onBeforeUnmount)((()=>{e.tween&&e.tween.stop(),h.forEach((e=>e&&e()))})),r?(0,n.onBeforeUnmount)((()=>a.lights.removeLight(e))):(0,n.onBeforeUnmount)((()=>e.destroy())),e},O=(e,t)=>(0,n.customRef)(((i,n)=>({get:()=>(i(),e),set(i){e&&i||(e=i?i[t]:null,n())}}))),j=e=>O(e,"object"),k=e=>O(e,"scene"),S=e=>t=>{const i=(0,n.inject)(e);i.push(t),(0,n.onBeforeUnmount)((()=>{const e=i.findIndex((e=>e===t));i.splice(e,1)}))},B=S("preUpdateEvents"),C=S("postUpdateEvents")},5:t=>{t.exports=e}},i={};function n(e){if(i[e])return i[e].exports;var s=i[e]={exports:{}};return t[e](s,s.exports,n),s.exports}return n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(207)})()}));
{
"name": "phavuer",
"version": "0.8.3",
"version": "0.8.4",
"description": "Reactive template engine based on Vue 3 for Phaser 3",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -17,2 +17,3 @@ # Phavuer

- [Phavuer RPG Example](https://github.com/laineus/phavuer-rpg-example) - An RPG example (This is just a usage example. Not a completed Game.)
- ["The Dream Libra had"](https://github.com/laineus/libra) - An RPG made with Phavuer (Completed project and published on Steam).

@@ -19,0 +20,0 @@ \*\*\* **Attention** \*\*\*

import { inject, watch, onBeforeUnmount, customRef } from 'vue'
import { default as setters, deepProps } from './setters'
import Scene from './components/Scene'
import Container from './components/Container'
import Rectangle from './components/Rectangle'
import RoundRectangle from './components/RoundRectangle'
import Circle from './components/Circle'
import Line from './components/Line'
import Image from './components/Image'
import Sprite from './components/Sprite'
import Text from './components/Text'
import TilemapLayer from './components/TilemapLayer'
import Zone from './components/Zone'
import Light from './components/Light'
import StaticBody from './components/StaticBody'
import Body from './components/Body'
import { default as setters, deepProps } from './setters.js'
import Scene from './components/Scene.vue'
import Container from './components/Container.vue'
import Rectangle from './components/Rectangle.vue'
import RoundRectangle from './components/RoundRectangle.vue'
import Circle from './components/Circle.vue'
import Line from './components/Line.vue'
import Image from './components/Image.vue'
import Sprite from './components/Sprite.vue'
import Text from './components/Text.vue'
import TilemapLayer from './components/TilemapLayer.vue'
import Zone from './components/Zone.vue'
import Light from './components/Light.vue'
import StaticBody from './components/StaticBody.vue'
import Body from './components/Body.vue'

@@ -46,6 +46,7 @@ const createPhavuerApp = (game, app) => {

// Make it reactive
const watchStoppers = Object.keys(props).map(key => {
const watchStoppers = Object.entries(props).map(([key, value]) => {
if (value === undefined) return
if (!setters[key]) return
const setter = setters[key](object)
setter(props[key])
setter(value)
return watch(() => props[key], setter, { deep: deepProps.includes(key) })

@@ -52,0 +53,0 @@ })

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc