idk
This commit is contained in:
1 parent
40fdf2a04e
commit
cdba43e8ec
175 files changed
+35233
No files matched your search
@@ -0,0 +1,2 @@
|
||||
var gdjs;(function(a){class g{constructor(t,i){this.center={x:0,y:0};this.origin={x:0,y:0};this.hasCustomHitBoxes=!1;this.customHitBoxes=[];this.image=i?i.image:"",this.texture=a.SpriteRuntimeObjectRenderer.getAnimationFrame(t,this.image),this.points=new Hashtable,this.reinitialize(t,i)}reinitialize(t,i){this.points.clear();for(let n=0,o=i.points.length;n<o;++n){const h=i.points[n],r={x:h.x,y:h.y};this.points.put(h.name,r)}const e=i.originPoint;this.origin.x=e.x,this.origin.y=e.y;const s=i.centerPoint;if(s.automatic!==!0?(this.center.x=s.x,this.center.y=s.y):(this.center.x=a.SpriteRuntimeObjectRenderer.getAnimationFrameWidth(this.texture)/2,this.center.y=a.SpriteRuntimeObjectRenderer.getAnimationFrameHeight(this.texture)/2),i.hasCustomCollisionMask){this.hasCustomHitBoxes=!0;let n=0;for(let o=i.customCollisionMask.length;n<o;++n){const h=i.customCollisionMask[n];n>=this.customHitBoxes.length&&this.customHitBoxes.push(new a.Polygon);let r=0;for(const u=h.length;r<u;++r){const l=h[r];r>=this.customHitBoxes[n].vertices.length&&this.customHitBoxes[n].vertices.push([0,0]),this.customHitBoxes[n].vertices[r][0]=l.x,this.customHitBoxes[n].vertices[r][1]=l.y}this.customHitBoxes[n].vertices.length=r}this.customHitBoxes.length=n}else this.customHitBoxes.length=0}getPoint(t){return t==="Centre"||t==="Center"?this.center:t==="Origin"?this.origin:this.points.containsKey(t)?this.points.get(t):this.origin}}a.SpriteAnimationFrame=g;class f{constructor(t,i){this.frames=[];this.timeBetweenFrames=i?i.timeBetweenFrames:1,this.loop=!!i.looping,this.reinitialize(t,i)}reinitialize(t,i){this.timeBetweenFrames=i?i.timeBetweenFrames:1,this.loop=!!i.looping;let e=0;for(const s=i.sprites.length;e<s;++e){const n=i.sprites[e];e<this.frames.length?this.frames[e].reinitialize(t,n):this.frames.push(new a.SpriteAnimationFrame(t,n))}this.frames.length=e}}a.SpriteAnimationDirection=f;class b{constructor(t,i){this.directions=[];this.hasMultipleDirections=!!i.useMultipleDirections,this.name=i.name||"",this.reinitialize(t,i)}reinitialize(t,i){this.hasMultipleDirections=!!i.useMultipleDirections,this.name=i.name||"";let e=0;for(const s=i.directions.length;e<s;++e){const n=i.directions[e];e<this.directions.length?this.directions[e].reinitialize(t,n):this.directions.push(new a.SpriteAnimationDirection(t,n))}this.directions.length=e}}a.SpriteAnimation=b;class m extends a.RuntimeObject{constructor(t,i){super(t,i);this._currentAnimation=0;this._currentDirection=0;this._currentFrame=0;this._animationElapsedTime=0;this._animationSpeedScale=1;this._animationPaused=!1;this._scaleX=1;this._scaleY=1;this._blendMode=0;this._flippedX=!1;this._flippedY=!1;this.opacity=255;this._animations=[];this._animationFrame=null;this._animationFrameDirty=!0;this._updateIfNotVisible=!!i.updateIfNotVisible;for(let e=0,s=i.animations.length;e<s;++e)this._animations.push(new a.SpriteAnimation(t.getGame().getImageManager(),i.animations[e]));this._renderer=new a.SpriteRuntimeObjectRenderer(this,t),this._updateAnimationFrame(),this.onCreated()}reinitialize(t){super.reinitialize(t);const i=this.getInstanceContainer();this._currentAnimation=0,this._currentDirection=0,this._currentFrame=0,this._animationElapsedTime=0,this._animationSpeedScale=1,this._animationPaused=!1,this._scaleX=1,this._scaleY=1,this._blendMode=0,this._flippedX=!1,this._flippedY=!1,this.opacity=255,this._updateIfNotVisible=!!t.updateIfNotVisible;let e=0;for(const s=t.animations.length;e<s;++e){const n=t.animations[e];e<this._animations.length?this._animations[e].reinitialize(i.getGame().getImageManager(),n):this._animations.push(new a.SpriteAnimation(i.getGame().getImageManager(),n))}this._animations.length=e,this._animationFrame=null,this._renderer.reinitialize(this,i),this._updateAnimationFrame(),this.onCreated()}updateFromObjectData(t,i){const e=this.getInstanceContainer();let s=0;for(const n=i.animations.length;s<n;++s){const o=i.animations[s];s<this._animations.length?this._animations[s].reinitialize(e.getGame().getImageManager(),o):this._animations.push(new a.SpriteAnimation(e.getGame().getImageManager(),o))}return this._animations.length=s,this._updateAnimationFrame(),this._animationFrame||this.setAnimationIndex(0),this.invalidateHitboxes(),!0}extraInitializationFromInitialInstance(t){if(t.numberProperties)for(let i=0,e=t.numberProperties.length;i<e;++i){const s=t.numberProperties[i];s.name==="animation"&&this.setAnimationIndex(s.value)}t.customSize&&(this.setWidth(t.width),this.setHeight(t.height))}update(t){if(!this._updateIfNotVisible&&!this._renderer.getRendererObject().visible||this._currentAnimation>=this._animations.length||this._currentDirection>=this._animations[this._currentAnimation].directions.length)return;const i=this._animations[this._currentAnimation].directions[this._currentDirection],e=this.getAnimationDuration();if(!this._animationPaused&&(i.loop||this._animationElapsedTime!==e)&&i.timeBetweenFrames){const s=this._animationElapsedTime+this.getElapsedTime()/1e3*this._animationSpeedScale;Line truncated
|
||||
//# sourceMappingURL=spriteruntimeobject.js.map
|
||||
Reference in new issue
Block a user