From 30bc231bba5f80bcd259c80716072cb8809c701a Mon Sep 17 00:00:00 2001 From: Luiz Bills Date: Sat, 12 Oct 2024 16:17:58 -0300 Subject: [PATCH] update engine --- package-lock.json | 6 +++--- public/about.html | 24 ++++++++---------------- public/images/colors.png | Bin 6627 -> 5407 bytes public/litecanvas.js | 2 +- public/sw.js | 2 +- public/tools/pixel-art-editor.html | 4 ++-- 6 files changed, 15 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 443279a..2b268c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -602,9 +602,9 @@ "integrity": "sha512-y6b2CN2rVTNnc6tYspFt61thfS14E3TPUyxFWJGvPxqNdXXOOlGBI8rM8pTIWlVzUhnHpY9tglk7X14Rj3/yMg==" }, "node_modules/litecanvas": { - "version": "0.60.0", - "resolved": "https://registry.npmjs.org/litecanvas/-/litecanvas-0.60.0.tgz", - "integrity": "sha512-z/815E5UVDE1HCDWsTNp5ozonfRK35pXTU24lNmlo1sL40aHRXX+LnzGXK5XSp26UWlOMxFZQAp0RmDUnos6Aw==" + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/litecanvas/-/litecanvas-0.61.0.tgz", + "integrity": "sha512-ZD+7U0Jp+Sw29theVWikBLtSotnbCBCvgL6GHsAQjm4qkrLEXfm0YDyzWBRX1e77CW0n/UGiX008b2y9vemRlQ==" }, "node_modules/pako": { "version": "2.1.0", diff --git a/public/about.html b/public/about.html index 6f4aab2..b415768 100644 --- a/public/about.html +++ b/public/about.html @@ -422,16 +422,10 @@

Functions for Drawing

// see: https://developer.mozilla.org/en-US/docs/Web/API/Path2D/Path2D path(arg?: Path2D | string): Path2D -// create a "circular" clipping region +// create a clipping region // see: https://github.com/litecanvas/game-engine/blob/main/samples/clip/clip.js -clipcirc(x, y, width, height): void - -// same as above, but create a "rectangular" clipping region -cliprect(x, y, width, height): void - -// note: before call `cliprect()` or `clipcirc()` you must -// save the context using `push()` and later, -// you must restore the context using `pop()` +// note: before call `clip()` you must save the context using `push()` and `pop()` +clipcirc(path: Path2D)

Functions for Sound

@@ -448,12 +442,10 @@

Functions for Sound

Functions for Keyboard

-

-        // Checks if which key is currently pressed in your keyboard.
-        // note: you can check if any key is pressed using `iskeydown("any")`.
-        // note: to check the space key use `iskeydown(" ")`.
-        iskeydown(key: string): boolean
-      
+
// Checks if which key is currently pressed in your keyboard.
+// note: you can check if any key is pressed using `iskeydown("any")`.
+// note: to check the space key use `iskeydown(" ")`.
+iskeydown(key: string): boolean

Math

@@ -635,7 +627,7 @@

Plugin API

setvar(name: string, value: any): void // Gets the color value. -// example: getcolor(0) returns "#000" +// example: getcolor(0) returns "#111" getcolor(index: number): string // Resizes the game canvas. diff --git a/public/images/colors.png b/public/images/colors.png index 778b4da91594ae9c63c4f4cd5e8446c434f91afb..451325795851eb4fbdd42ce3c826073d9e0625be 100644 GIT binary patch literal 5407 zcmdUzXHZjLx5h~zbm=7Yj`ZH7hhCK4LJtU16h(R`fS@$#U5XN=OAAsoAWeEl6andx zD$+q9yy5-7bMKwG-|n~jWzU}V?B6{O;bEP00(Xl zCnm(L=;~S+9v&S=PgBi2$YHlI7-sSHZ(oP^s8cE<5TMgd=;mx5u9QUp9I!cri%Q`tXvhEjPl5lpy8iQ^tUsrxhuulv`bzKi zJzsK>bh>`soqL2)yz^8tEeuuuMEw`WW#xNqXlhXi1!GQziJjdu2YiQ^g6EXMzxAP8 zVmyh8A#@i3d)i&~_gj34P(+E)}t8`1)XC%DP_|1ANJ|BU%H5qUJzvA(&w9({j~ zFyogI*2z3$;)T8KjC$I*?cSJ1fFXqgqYMy$JuR{Srjr)1De1vi4$2JJmyVdPXKBaE znAn-W$Xx3Y9P%2Oy#=*Ro-;7v1@(7%?-bD(U`kzn{kA3Vel+-%X$tz_c%7 zHrTt+sXmmNH{#;fjG-Z+pNG}+Of*fB9TflX$(Jtq#y=Yf&a>q*e9W_$7$Eh>Kt*h$ zpZvSwR|Y>wJONqR*a-A#^0Oq znPQvi#tT*ZYZOwD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qy zrGW6vgiTwS8~0||{e39o@S2jd683T2f~~T9?|X=bjHdh6=3aN#bDa41jq2tF{r&fK&%0=${KffI_I5tY-lvDtAu%yb2(BW!&T8-T;vNgHqLO+zuXh^3;bcLFHuj^wKWnfDIn0+5P{C-P|lh)77IZmcbsQRQgb z@d1dYFA*=iH7H&HDN2AvhNNq20Z3XxIR_Sin10liS%E1rD}Z>1zzZN=f9|&PDgfyu z!qyhd-76+rf8MzT%NoSJ3Ly0v5#P4es{o{PuXz|id?M$@2;K}x{em$@G7CV)bfaoz zWk5tq8oZT>0c0==2@QAwB+-R_Q=*|-03x3mA%_-#gybSOCI%3Bd@db&3_va;<1^3) z5N`>UuMd@0Tw5?trJo%AN&$%IAtWaS-fIJWvZJJ00Od9ceE@mzWUXt-9WAUHkf>s`_MQQdvuCP!szFl& h67QF47Q7um{||F6)_F_#;rIXm002ovPDHLkV1m0TSepO< diff --git a/public/litecanvas.js b/public/litecanvas.js index 6f38d5c..221ae5f 100644 --- a/public/litecanvas.js +++ b/public/litecanvas.js @@ -1,4 +1,4 @@ -(()=>{var e=/* @__PURE__ */new AudioContext;globalThis.zzfxV=1;var t=(t=1,a=.05,n=220,l=0,r=0,i=.1,o=0,s=1,c=0,f=0,p=0,u=0,d=0,g=0,h=0,m=0,v=0,T=1,x=0,b=0,E=0)=>{let y=Math,w=2*y.PI,H=c*=500*w/44100/44100,D=n*=(1-a+2*a*y.random(a=[]))*w/44100,A=0,I=0,S=0,P=1,k=0,C=0,z=0,F=E<0?-1:1,O=w*F*E*2/44100,X=y.cos(O),L=y.sin,W=L(O)/4,Y=1+W,M=-2*X/Y,_=(1-W)/Y,B=(1+F*X)/2/Y,G=-(F+X)/Y,R=0,N=0,j=0,q=0;for(l=44100*l+9,x*=44100,r*=44100,i*=44100,v*=44100,f*=500*w/85766121e6,h*=w/44100,p*=w/44100,u*=44100,d=44100*d|0,t*=.3*globalThis.zzfxV,F=l+x+r+i+v|0;SS?0:(Su&&(n+=p,D+=p,P=0),!d||++k%d||(n=D,c=H,P=P||1);(t=e.createBuffer(1,F,44100)).getChannelData(0).set(a),(n=e.createBufferSource()).buffer=t,n.connect(e.destination),n.start()},a=["#000","#6a7799","#aec2c2","#FFF1E8","#d82800","#f8d878","#155fd9","#3cbcfc","#327345","#63c64d","#6844fc","#ac7c00"];globalThis.litecanvas=function(e={}){let n=globalThis,l=Math.PI,r=2*l,i=(e,t,a)=>e.addEventListener(t,a);e=Object.assign({fps:60,fullscreen:!0,width:null,height:null,autoscale:!0,pixelart:!1,antialias:!1,canvas:null,global:!0,loop:null,pauseOnBlur:!0,tapEvents:!0,keyboardEvents:!0,animate:!0},e);let o=!1,s=[],c=e.canvas||document.createElement("canvas"),f=e.fullscreen,p=e.autoscale,u=e.animate,d=1,g,h=1,m,v=1/e.fps,T=1e3*v,x=0,b,E=0,y=0,w="sans-serif",H="",D=32,A=Date.now(),I={init:!1,update:!1,draw:!1,resized:!1,tap:!1,untap:!1,tapping:!1,tapped:!1},S={settings:Object.assign({},e),colors:a},P={WIDTH:e.width,HEIGHT:e.height||e.width,CANVAS:null,ELAPSED:0,FPS:e.fps,CENTERX:0,CENTERY:0,MOUSEX:-1,MOUSEY:-1,DEFAULT_SFX:[.5,,1675,,.06,.2,1,1.8,,,637,.06],PI:l,TWO_PI:r,HALF_PI:.5*l,lerp:(e,t,a)=>e+a*(t-e),deg2rad:e=>l/180*e,rad2deg:e=>180/l*e,clamp:(e,t,a)=>ea?a:e,wrap:(e,t,a)=>e-(a-t)*Math.floor((e-t)/(a-t)),map(e,t,a,n,l,r=!1){let i=(e-t)/(a-t)*(l-n)+n;return r?P.clamp(i,n,l):i},norm:(e,t,a)=>P.map(e,t,a,0,1),rand:(e=0,t=1)=>(A=(1664525*A+0x3c6ef35f)%0x100000000)/0x100000000*(t-e)+e,randi:(e=0,t=1)=>P.floor(P.rand(e,t+1)),seed:e=>null==e?A:A=~~e,cls(e){null==e?g.clearRect(0,0,P.WIDTH,P.HEIGHT):P.rectfill(0,0,P.WIDTH,P.HEIGHT,e)},rect(e,t,a,n,l=0,r=null){g.beginPath(),g[r?"roundRect":"rect"](~~e,~~t,a,n,r),P.stroke(l)},rectfill(e,t,a,n,l=0,r=null){g.beginPath(),g[r?"roundRect":"rect"](~~e,~~t,a,n,r),P.fill(l)},circ(e,t,a,n){g.beginPath(),g.arc(~~e,~~t,a,0,r),g.closePath(),P.stroke(n)},circfill(e,t,a,n){g.beginPath(),g.arc(~~e,~~t,a,0,r),g.closePath(),P.fill(n)},line(e,t,a,n,l){g.beginPath(),g.moveTo(~~e,~~t),g.lineTo(~~a,~~n),P.stroke(l)},linewidth(e){g.lineWidth=e},linedash(e,t=0){g.setLineDash(Array.isArray(e)?e:[e]),g.lineDashOffset=t},text(e,t,a,n=3){g.font=`${H} ${D}px ${w}`,g.fillStyle=P.getcolor(n),g.fillText(a,~~e,~~t)},textfont(e){w=e},textsize(e){D=e},textstyle(e){H=e||""},textalign(e,t){e&&(g.textAlign=e),t&&(g.textBaseline=t)},textmetrics(e,t=D){g.font=`${H} ${t}px ${w}`;let a=g.measureText(e);return a.height=a.actualBoundingBoxAscent+a.actualBoundingBoxDescent,a},image(e,t,a){g.drawImage(a,~~e,~~t)},paint(e,t,a,n={}){let l=n.canvas||new OffscreenCanvas(1,1),r=n.scale||1,i=g;if(l.width=e*r,l.height=t*r,(g=l.getContext("2d")).scale(r,r),Array.isArray(a)){let e=0,t=0;for(let n of(g.imageSmoothingEnabled=!1,a)){for(let a of n)" "!==a&&"."!==a&&P.rectfill(e,t,1,1,parseInt(a,16)),e++;t++,e=0}}else a(l,g);return g=i,l},ctx:e=>(e&&(g=e),g),push:()=>g.save(),pop:()=>g.restore(),translate:(e,t)=>g.translate(~~e,~~t),scale:(e,t)=>g.scale(e,t||e),rotate:e=>g.rotate(e),transform:(e,t,a,n,l,r,i=!0)=>g[i?"setTransform":"transform"](e,t,a,n,l,r),alpha(e){g.globalAlpha=P.clamp(e,0,1)},path:e=>new Path2D(e),fill(e,t){g.fillStyle=P.getcolor(e),t?g.fill(t):g.fill()},stroke(e,t){g.strokeStyle=P.getcolor(e),t?g.stroke(t):g.stroke()},cliprect(e,t,a,n){g.beginPath(),g.rect(e,t,a,n),g.clip()},clipcirc(e,t,a){g.beginPath(),g.arc(e,t,a,0,r),g.clip()},sfx:(e,a=0,l=1)=>!(n.zzfxV<=0)&&(!navigator.userActivation||!!navigator.userActivation.hasBeenActive)&&(e=e||P.DEFAULT_SFX,(a>0||1!==l)&&((e=e.slice())[0]=l*(e[0]||1),e[10]=~~e[10]+a),t.apply(0,e),e),volume(e){n.zzfxV=+e},colrect:(e,t,a,n,l,r,i,o)=>el&&tr,colcirc:(e,t,a,n,l,r)=>(n-e)**2+(l-t)**2<=(a+r)**2,timescale(e){h=e},use(e,t={}){e.__conf=t,o?O(e):s.push(e)},listen:(e,t)=>(I[e]=I[e]||[],I[e].push(t),()=>{I[e]=I[e].filter(e=>t!==e)}),emit(e,t,a,n,l){F("before:"+e,t,a,n,l),F(e,t,a,n,l),F("after:"+e,t,a,n,l)},getcolor:e=>a[~~e%a.length],setvar(t,a){P[t]=a,e.global&&(n[t]=a)},resize(e,t){P.setvar("WIDTH",c.width=e),P.setvar("HEIGHT",c.height=t||e),z()}};for(let e of["sin","cos","atan2","hypot","tan","abs","ceil","round","floor","trunc","min","max","pow","sqrt","sign","exp"])P[e]=Math[e];function k(){o=!0,c="string"==typeof c?document.querySelector(c):c,P.setvar("CANVAS",c),g=c.getContext("2d"),P.WIDTH>0&&(f=!1),c.width=P.WIDTH,c.height=P.HEIGHT||P.WIDTH,c.parentNode||document.body.appendChild(c),c.style.display="block",f?(c.style.position="absolute",c.style.inset=0):p&&(c.style.margin="auto");let t=e.loop?e.loop:n;for(let e of Object.keys(I))t[e]&&P.listen(e,t[e]);for(let e of s)O(e);if(i(n,"resize",z),z(),e.tapEvents){let e=(e,t)=>[(e-c.offsetLeft)/d,(t-c.offsetTop)/d],t=/* @__PURE__ */new Map,a=(e,a,n)=>{let l={x:a,y:n,startX:a,startY:n,ts:performance.now()};return t.set(e,l),l},l=(e,n,l)=>{let r=t.get(e)||a(e);r.x=n,r.y=l},r=e=>e&&performance.now()-e.ts<=200,o=!1;i(c,"mousedown",t=>{t.preventDefault();let[n,l]=e(t.pageX,t.pageY);P.emit("tap",n,l,0),a(0,n,l),o=!0}),i(c,"mousemove",t=>{t.preventDefault();let[a,n]=e(t.pageX,t.pageY);P.setvar("MOUSEX",a),P.setvar("MOUSEY",n),o&&(P.emit("tapping",a,n,0),l(0,a,n))}),i(c,"mouseup",a=>{a.preventDefault();let n=t.get(0),[l,i]=e(a.pageX,a.pageY);r(n)&&P.emit("tapped",n.startX,n.startY,0),P.emit("untap",l,i,0),t.delete(0),o=!1}),i(c,"touchstart",t=>{for(let n of(t.preventDefault(),t.changedTouches)){let[t,l]=e(n.pageX,n.pageY);P.emit("tap",t,l,n.identifier+1),a(n.identifier+1,t,l)}}),i(c,"touchmove",t=>{for(let a of(t.preventDefault(),t.changedTouches)){let[t,n]=e(a.pageX,a.pageY);P.emit("tapping",t,n,a.identifier+1),l(a.identifier+1,t,n)}});let s=e=>{e.preventDefault();let a=[];if(e.targetTouches.length>0)for(let t of e.targetTouches)a.push(t.identifier+1);for(let[e,n]of t)a.includes(e)||(r(n)&&P.emit("tapped",n.startX,n.startY,e),P.emit("untap",n.x,n.y,e),t.delete(e))};i(c,"touchend",s),i(c,"touchcancel",s),i(n,"blur",()=>{for(let[e,a]of(o=!1,t))P.emit("untap",a.x,a.y,e),t.delete(e)})}if(e.keyboardEvents){let e=/* @__PURE__ */new Set;P.setvar("iskeydown",t=>"any"===t?e.size>0:e.has(t.toLowerCase())),i(n,"keydown",t=>{e.add(t.key.toLowerCase())}),i(n,"keyup",t=>{e.delete(t.key.toLowerCase())}),i(n,"blur",()=>e.clear())}e.pauseOnBlur&&(i(n,"blur",()=>{b=null}),i(n,"focus",()=>{b||(m=performance.now(),b=requestAnimationFrame(C))})),P.emit("init",P),m=performance.now(),b=requestAnimationFrame(C)}function C(e){let t=0,a=e-m;for(m=e,x+=a;x>=T;)P.emit("update",v*h),P.setvar("ELAPSED",P.ELAPSED+v*h),x-=T,t++;(t||!u)&&(P.textalign("start","top"),P.emit("draw"),E++,(y+=T*t)+x>=1e3&&(P.setvar("FPS",E),E=0,y-=1e3)),b&&u&&(b=requestAnimationFrame(C))}function z(){let t=n.innerWidth,a=n.innerHeight;f?(P.setvar("WIDTH",c.width=t),P.setvar("HEIGHT",c.height=a)):p&&(d=Math.min(t/P.WIDTH,a/P.HEIGHT),d=(e.pixelart?~~d:d)||1,c.style.width=P.WIDTH*d+"px",c.style.height=P.HEIGHT*d+"px"),P.setvar("CENTERX",P.WIDTH/2),P.setvar("CENTERY",P.HEIGHT/2),(!e.antialias||e.pixelart)&&(g.imageSmoothingEnabled=!1,c.style.imageRendering="pixelated"),P.emit("resized",d),u||(m=performance.now(),requestAnimationFrame(C))}function F(e,t,a,n,l){if(I[e])for(let r of I[e])r(t,a,n,l)}function O(e){let t=e(P,S,e.__conf);if("object"==typeof t)for(let[e,a]of Object.entries(t))P.setvar(e,a)}if(e.global){if(n.__litecanvas)throw"global litecanvas already instantiated";Object.assign(n,P),n.__litecanvas=P}return"loading"===document.readyState?i(n,"DOMContentLoaded",k):k(),P}})(); +(()=>{var e=/* @__PURE__ */new AudioContext;globalThis.zzfxV=1;var t=(t=1,a=.05,n=220,l=0,r=0,i=.1,o=0,s=1,c=0,f=0,p=0,u=0,d=0,g=0,h=0,m=0,v=0,T=1,x=0,E=0,b=0)=>{let y=Math,w=2*y.PI,H=c*=500*w/44100/44100,D=n*=(1-a+2*a*y.random(a=[]))*w/44100,A=0,I=0,S=0,k=1,C=0,P=0,z=0,F=b<0?-1:1,O=w*F*b*2/44100,X=y.cos(O),L=y.sin,W=L(O)/4,Y=1+W,M=-2*X/Y,_=(1-W)/Y,B=(1+F*X)/2/Y,G=-(F+X)/Y,R=0,N=0,j=0,q=0;for(l=44100*l+9,x*=44100,r*=44100,i*=44100,v*=44100,f*=500*w/85766121e6,h*=w/44100,p*=w/44100,u*=44100,d=44100*d|0,t*=.3*globalThis.zzfxV,F=l+x+r+i+v|0;SS?0:(Su&&(n+=p,D+=p,k=0),!d||++C%d||(n=D,c=H,k=k||1);(t=e.createBuffer(1,F,44100)).getChannelData(0).set(a),(n=e.createBufferSource()).buffer=t,n.connect(e.destination),n.start()},a=["#111","#6a7799","#aec2c2","#FFF1E8","#d82800","#f8d878","#155fd9","#3cbcfc","#327345","#63c64d","#6844fc","#ac7c00"];globalThis.litecanvas=function(e={}){let n=globalThis,l=Math.PI,r=2*l,i=(e,t,a)=>e.addEventListener(t,a);e=Object.assign({fps:60,fullscreen:!0,width:null,height:null,autoscale:!0,pixelart:!1,antialias:!1,canvas:null,global:!0,loop:null,pauseOnBlur:!0,tapEvents:!0,keyboardEvents:!0,animate:!0},e);let o=!1,s=[],c=e.canvas||document.createElement("canvas"),f=e.fullscreen,p=e.autoscale,u=e.animate,d=1,g,h=1,m,v=1/e.fps,T=1e3*v,x=0,E,b=0,y=0,w="sans-serif",H="",D=32,A=Date.now(),I={init:!1,update:!1,draw:!1,resized:!1,tap:!1,untap:!1,tapping:!1,tapped:!1},S={settings:Object.assign({},e),colors:a},k={WIDTH:e.width,HEIGHT:e.height||e.width,CANVAS:null,ELAPSED:0,FPS:e.fps,CENTERX:0,CENTERY:0,MOUSEX:-1,MOUSEY:-1,DEFAULT_SFX:[.5,,1675,,.06,.2,1,1.8,,,637,.06],PI:l,TWO_PI:r,HALF_PI:.5*l,lerp:(e,t,a)=>e+a*(t-e),deg2rad:e=>l/180*e,rad2deg:e=>180/l*e,clamp:(e,t,a)=>ea?a:e,wrap:(e,t,a)=>e-(a-t)*Math.floor((e-t)/(a-t)),map(e,t,a,n,l,r=!1){let i=(e-t)/(a-t)*(l-n)+n;return r?k.clamp(i,n,l):i},norm:(e,t,a)=>k.map(e,t,a,0,1),rand:(e=0,t=1)=>(A=(1664525*A+0x3c6ef35f)%0x100000000)/0x100000000*(t-e)+e,randi:(e=0,t=1)=>k.floor(k.rand(e,t+1)),seed:e=>null==e?A:A=~~e,cls(e){null==e?g.clearRect(0,0,k.WIDTH,k.HEIGHT):k.rectfill(0,0,k.WIDTH,k.HEIGHT,e)},rect(e,t,a,n,l=0,r=null){g.beginPath(),g[r?"roundRect":"rect"](~~e,~~t,a,n,r),k.stroke(l)},rectfill(e,t,a,n,l=0,r=null){g.beginPath(),g[r?"roundRect":"rect"](~~e,~~t,a,n,r),k.fill(l)},circ(e,t,a,n){g.beginPath(),g.arc(~~e,~~t,a,0,r),g.closePath(),k.stroke(n)},circfill(e,t,a,n){g.beginPath(),g.arc(~~e,~~t,a,0,r),g.closePath(),k.fill(n)},line(e,t,a,n,l){g.beginPath(),g.moveTo(~~e,~~t),g.lineTo(~~a,~~n),k.stroke(l)},linewidth(e){g.lineWidth=e},linedash(e,t=0){g.setLineDash(Array.isArray(e)?e:[e]),g.lineDashOffset=t},text(e,t,a,n=3){g.font=`${H} ${D}px ${w}`,g.fillStyle=k.getcolor(n),g.fillText(a,~~e,~~t)},textfont(e){w=e},textsize(e){D=e},textstyle(e){H=e||""},textalign(e,t){e&&(g.textAlign=e),t&&(g.textBaseline=t)},textmetrics(e,t=D){g.font=`${H} ${t}px ${w}`;let a=g.measureText(e);return a.height=a.actualBoundingBoxAscent+a.actualBoundingBoxDescent,a},image(e,t,a){g.drawImage(a,~~e,~~t)},paint(e,t,a,n={}){let l=n.canvas||new OffscreenCanvas(1,1),r=n.scale||1,i=g;if(l.width=e*r,l.height=t*r,(g=l.getContext("2d")).scale(r,r),Array.isArray(a)){let e=0,t=0;for(let n of(g.imageSmoothingEnabled=!1,a)){for(let a of n)" "!==a&&"."!==a&&k.rectfill(e,t,1,1,parseInt(a,16)),e++;t++,e=0}}else a(l,g);return g=i,l},ctx:e=>(e&&(g=e),g),push:()=>g.save(),pop:()=>g.restore(),translate:(e,t)=>g.translate(~~e,~~t),scale:(e,t)=>g.scale(e,t||e),rotate:e=>g.rotate(e),transform:(e,t,a,n,l,r,i=!0)=>g[i?"setTransform":"transform"](e,t,a,n,l,r),alpha(e){g.globalAlpha=k.clamp(e,0,1)},path:e=>new Path2D(e),fill(e,t){g.fillStyle=k.getcolor(e),t?g.fill(t):g.fill()},stroke(e,t){g.strokeStyle=k.getcolor(e),t?g.stroke(t):g.stroke()},clip(e){g.clip(e)},sfx:(e,a=0,l=1)=>!(n.zzfxV<=0)&&(!navigator.userActivation||!!navigator.userActivation.hasBeenActive)&&(e=e||k.DEFAULT_SFX,(a>0||1!==l)&&((e=e.slice())[0]=l*(e[0]||1),e[10]=~~e[10]+a),t.apply(0,e),e),volume(e){n.zzfxV=+e},colrect:(e,t,a,n,l,r,i,o)=>el&&tr,colcirc:(e,t,a,n,l,r)=>(n-e)**2+(l-t)**2<=(a+r)**2,timescale(e){h=e},use(e,t={}){e.__conf=t,o?O(e):s.push(e)},listen:(e,t)=>(I[e]=I[e]||[],I[e].push(t),()=>{I[e]=I[e].filter(e=>t!==e)}),emit(e,t,a,n,l){F("before:"+e,t,a,n,l),F(e,t,a,n,l),F("after:"+e,t,a,n,l)},getcolor:e=>a[~~e%a.length],setvar(t,a){k[t]=a,e.global&&(n[t]=a)},resize(e,t){k.setvar("WIDTH",c.width=e),k.setvar("HEIGHT",c.height=t||e),z()}};for(let e of["sin","cos","atan2","hypot","tan","abs","ceil","round","floor","trunc","min","max","pow","sqrt","sign","exp"])k[e]=Math[e];function C(){o=!0,c="string"==typeof c?document.querySelector(c):c,k.setvar("CANVAS",c),g=c.getContext("2d"),k.WIDTH>0&&(f=!1),c.width=k.WIDTH,c.height=k.HEIGHT||k.WIDTH,c.parentNode||document.body.appendChild(c),c.style.display="block",f?(c.style.position="absolute",c.style.inset=0):p&&(c.style.margin="auto");let t=e.loop?e.loop:n;for(let e of Object.keys(I))t[e]&&k.listen(e,t[e]);for(let e of s)O(e);if(i(n,"resize",z),z(),e.tapEvents){let e=(e,t)=>[(e-c.offsetLeft)/d,(t-c.offsetTop)/d],t=/* @__PURE__ */new Map,a=(e,a,n)=>{let l={x:a,y:n,startX:a,startY:n,ts:performance.now()};return t.set(e,l),l},l=(e,n,l)=>{let r=t.get(e)||a(e);r.x=n,r.y=l},r=e=>e&&performance.now()-e.ts<=200,o=!1;i(c,"mousedown",t=>{t.preventDefault();let[n,l]=e(t.pageX,t.pageY);k.emit("tap",n,l,0),a(0,n,l),o=!0}),i(c,"mousemove",t=>{t.preventDefault();let[a,n]=e(t.pageX,t.pageY);k.setvar("MOUSEX",a),k.setvar("MOUSEY",n),o&&(k.emit("tapping",a,n,0),l(0,a,n))}),i(c,"mouseup",a=>{a.preventDefault();let n=t.get(0),[l,i]=e(a.pageX,a.pageY);r(n)&&k.emit("tapped",n.startX,n.startY,0),k.emit("untap",l,i,0),t.delete(0),o=!1}),i(c,"touchstart",t=>{for(let n of(t.preventDefault(),t.changedTouches)){let[t,l]=e(n.pageX,n.pageY);k.emit("tap",t,l,n.identifier+1),a(n.identifier+1,t,l)}}),i(c,"touchmove",t=>{for(let a of(t.preventDefault(),t.changedTouches)){let[t,n]=e(a.pageX,a.pageY);k.emit("tapping",t,n,a.identifier+1),l(a.identifier+1,t,n)}});let s=e=>{e.preventDefault();let a=[];if(e.targetTouches.length>0)for(let t of e.targetTouches)a.push(t.identifier+1);for(let[e,n]of t)a.includes(e)||(r(n)&&k.emit("tapped",n.startX,n.startY,e),k.emit("untap",n.x,n.y,e),t.delete(e))};i(c,"touchend",s),i(c,"touchcancel",s),i(n,"blur",()=>{for(let[e,a]of(o=!1,t))k.emit("untap",a.x,a.y,e),t.delete(e)})}if(e.keyboardEvents){let e=/* @__PURE__ */new Set;k.setvar("iskeydown",t=>"any"===t?e.size>0:e.has(t.toLowerCase())),i(n,"keydown",t=>{e.add(t.key.toLowerCase())}),i(n,"keyup",t=>{e.delete(t.key.toLowerCase())}),i(n,"blur",()=>e.clear())}e.pauseOnBlur&&(i(n,"blur",()=>{E=null}),i(n,"focus",()=>{E||(m=performance.now(),E=requestAnimationFrame(P))})),k.emit("init",k),m=performance.now(),E=requestAnimationFrame(P)}function P(e){let t=0,a=e-m;for(m=e,x+=a;x>=T;)k.emit("update",v*h),k.setvar("ELAPSED",k.ELAPSED+v*h),x-=T,t++;(t||!u)&&(k.textalign("start","top"),k.emit("draw"),b++,(y+=T*t)+x>=1e3&&(k.setvar("FPS",b),b=0,y-=1e3)),E&&u&&(E=requestAnimationFrame(P))}function z(){let t=n.innerWidth,a=n.innerHeight;f?(k.setvar("WIDTH",c.width=t),k.setvar("HEIGHT",c.height=a)):p&&(d=Math.min(t/k.WIDTH,a/k.HEIGHT),d=(e.pixelart?~~d:d)||1,c.style.width=k.WIDTH*d+"px",c.style.height=k.HEIGHT*d+"px"),k.setvar("CENTERX",k.WIDTH/2),k.setvar("CENTERY",k.HEIGHT/2),(!e.antialias||e.pixelart)&&(g.imageSmoothingEnabled=!1,c.style.imageRendering="pixelated"),k.emit("resized",d),u||(m=performance.now(),requestAnimationFrame(P))}function F(e,t,a,n,l){if(I[e])for(let r of I[e])r(t,a,n,l)}function O(e){let t=e(k,S,e.__conf);if("object"==typeof t)for(let[e,a]of Object.entries(t))k.setvar(e,a)}if(e.global){if(n.__litecanvas)throw"global litecanvas already instantiated";Object.assign(n,k),n.__litecanvas=k}return"loading"===document.readyState?i(n,"DOMContentLoaded",C):C(),k}})(); (()=>{var J=Object.defineProperty;var Q=(e,t)=>{for(var s in t)J(e,s,{get:t[s],enumerable:!0})};globalThis.utils=globalThis.utils||{};globalThis.utils.global=()=>{for(let e in globalThis.utils)e!=="global"&&(globalThis[e]=globalThis.utils[e])};var D={};Q(D,{ANCHOR_BOT_LEFT:()=>bt,ANCHOR_BOT_RIGHT:()=>At,ANCHOR_CENTER:()=>Mt,ANCHOR_TOP_LEFT:()=>V,ANCHOR_TOP_RIGHT:()=>It,Actor:()=>C,BACK_IN:()=>kt,BACK_IN_OUT:()=>Pt,BACK_OUT:()=>Dt,BOUNCE_IN:()=>Z,BOUNCE_IN_OUT:()=>Yt,BOUNCE_OUT:()=>k,Camera:()=>f,DOWN:()=>wt,EASE_IN:()=>Ot,EASE_IN_OUT:()=>St,EASE_OUT:()=>Ct,ELASTIC_IN:()=>Lt,ELASTIC_IN_OUT:()=>Rt,ELASTIC_OUT:()=>Xt,Grid:()=>g,LEFT:()=>Et,LINEAR:()=>K,ONE:()=>yt,RIGHT:()=>Tt,TypedGrid:()=>M,UP:()=>mt,Vector:()=>p,ZERO:()=>F,advance:()=>q,diff:()=>G,fract:()=>z,intersection:()=>d,range:()=>$,resolve:()=>L,tween:()=>Ht,vec:()=>n,vecAbs:()=>ut,vecAdd:()=>A,vecAngle:()=>nt,vecAngleBetween:()=>ht,vecCeil:()=>ft,vecClamp:()=>xt,vecCross:()=>at,vecDist:()=>rt,vecDist2:()=>ot,vecDiv:()=>y,vecDot:()=>N,vecEq:()=>b,vecFloor:()=>pt,vecIsZero:()=>gt,vecLerp:()=>ct,vecLimit:()=>it,vecMag:()=>U,vecMag2:()=>W,vecMove:()=>dt,vecMult:()=>_,vecNorm:()=>O,vecRand:()=>lt,vecReflect:()=>et,vecRotate:()=>tt,vecRound:()=>_t,vecSet:()=>B,vecSetMag:()=>st,vecSub:()=>H,wave:()=>j});var d=(e,t,s,i,r,o,h,a)=>{let c=Math.max(e,r),P=Math.min(e+s,r+h)-c,x=Math.max(t,o),T=Math.min(t+i,o+a)-x;return[c,x,P,T]};var L=(e,t,s,i,r,o,h,a)=>{let[c,P,x,T]=d(e,t,s,i,r,o,h,a),u="",w=e,E=t;return x{this._shake.x=this._engine.randi(-t,t),this._shake.y=this._engine.randi(-t,t),s-=i,s<=0&&this.unshake()}))}unshake(){this.shaking&&(this._shake.removeListener(),this._shake.removeListener=null,this._shake.x=this._shake.y=0)}get shaking(){return this._shake.removeListener!==null}};var g=class e{_w;_h;_c;constructor(t,s,i=[]){this._w=Math.max(1,~~t),this._h=Math.max(1,~~s),this._c=i}[Symbol.iterator](){let t=0;return{next:()=>({value:[this.indexToPointX(t),this.indexToPointY(t),this._c[t++]],done:t>this._c.length})}}clone(){return new e(this._w,this._h,this._c)}clear(){this.forEach((t,s)=>this.set(t,s,void 0))}get width(){return this._w}get height(){return this._h}set(t,s,i){this._c[this.pointToIndex(t,s)]=i}get(t,s){return this._c[this.pointToIndex(t,s)]}has(t,s){return this.get(t,s)!=null}check(t,s){return t>=0&&t=0&&s{this.set(s,i,t)})}clampX(t){return X(t,0,this._w-1)}clampY(t){return X(t,0,this._h-1)}toArray(){return this._c.slice()}toString(t=" ",s=!0){if(!s)return this._c.join(t);let i=[];return this.forEach((r,o,h)=>{i[o]=i[o]||"",i[o]+=h+t}),i.join(` `)}},M=class e extends g{constructor(t,s,i=Uint8Array){super(t,s,null),this._c=new i(this._w*this._h)}has(t,s){return this.get(t,s)!==0}clone(){let t=new e(this._w,this._h,this._c.constructor);return this.forEach((s,i,r)=>{t.set(s,i,r)}),t}};function X(e,t,s){return es?s:e}var I=Math.sqrt,R=Math.cos,Y=Math.sin,v=2*Math.PI,p=class{x;y;constructor(t=0,s=t){this.x=t,this.y=s}toString(){return`Vector (${this.x}, ${this.y})`}},l=e=>e instanceof p,n=(e=0,t=e)=>(l(e)&&(t=e.y,e=e.x),new p(e,t)),b=(e,t,s=t)=>l(t)?b(e,t.x,t.y):e.x===t&&e.y===s,B=(e,t,s=t)=>(l(t)?B(e,t.x,t.y):(e.x=t,e.y=s),e),A=(e,t,s=t)=>l(t)?A(e,t.x,t.y):(e.x+=t,e.y+=s,e),H=(e,t,s=t)=>l(t)?H(e,t.x,t.y):(e.x-=t,e.y-=s,e),_=(e,t,s=t)=>l(t)?_(e,t.x,t.y):(e.x*=t,e.y*=s,e),y=(e,t,s=t)=>l(t)?y(e,t.x,t.y):(e.x/=t||1,e.y/=s||1,e),tt=(e,t)=>{let s=R(t),i=Y(t);return e.x=s*e.x-i*e.y,e.y=i*e.x+s*e.y,e},et=(e,t)=>{let s=O(n(t));return H(e,_(s,2*N(e,s)))},st=(e,t)=>(O(e),_(e,t),e),U=e=>I(e.x*e.x+e.y*e.y),W=e=>e.x*e.x+e.y*e.y,O=e=>{let t=U(e);return t>0&&y(e,t),e},it=(e,t=1)=>{let s=W(e);return s>t*t&&(y(e,I(s)),_(e,t)),e},rt=(e,t)=>{let s=e.x-t.x,i=e.y-t.y;return I(s*s+i*i)},ot=(e,t)=>{let s=e.x-t.x,i=e.y-t.y;return s*s+i*i},nt=e=>Math.atan2(e.y,e.x),ht=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),N=(e,t)=>e.x*t.x+e.y*t.y,at=(e,t)=>e.x*t.y-e.y*t.x,ct=(e,t,s)=>(e.x+=(t.x-e.x)*s||0,e.y+=(t.y-e.y)*s||0,e),lt=(e=1,t=e,s=globalThis.rand||Math.random)=>{let i=s()*v,r=s()*(t-e)+e;return n(R(i)*r,Y(i)*r)},ut=e=>(e.x=Math.abs(e.x),e.y=Math.abs(e.y),e),ft=e=>(e.x=Math.ceil(e.x),e.y=Math.ceil(e.y),e),pt=e=>(e.x=Math.floor(e.x),e.y=Math.floor(e.y),e),_t=e=>(e.x=Math.round(e.x),e.y=Math.round(e.y),e),xt=(e,t,s)=>(e.xs.x&&(e.x=s.x),e.ys.y&&(e.y=s.y),e),dt=(e,t,s=1)=>A(e,t.x*s,t.y*s),gt=e=>b(e,F),F=n(0,0),yt=n(1,1),mt=n(0,-1),Tt=n(1,0),wt=n(0,1),Et=n(-1,0);globalThis.zzfxV=1;var Mt=n(.5,.5),V=n(0,0),It=n(1,0),bt=n(0,1),At=n(1,1),C=class{sprite;pos;_o;_s;flipX=!1;flipY=!1;angle=0;opacity=1;hidden=!1;constructor(t,s,i=V){this.sprite=t,this.pos=s||n(0),this._o=n(i),this._s=n(1,1)}set x(t){this.pos.x=t}get x(){return this.pos.x}set y(t){this.pos.y=t}get y(){return this.pos.y}set anchor(t){this._o.x=t.x,this._o.y=t.y}get anchor(){return this._o}get width(){return this.sprite.width*this._s.x}get height(){return this.sprite.height*this._s.y}get scale(){return this._s}scaleTo(t,s=t){this._s.x=t,this._s.y=s}scaleBy(t,s=t){this._s.x*=t,this._s.y*=s}getBounds(t=!0){let s=this.sprite.width*(t?this._s.x:1),i=this.sprite.height*(t?this._s.y:1),r=this.pos.x-s*this.anchor.x,o=this.pos.y-i*this.anchor.y;return[r,o,s,i]}draw(t=globalThis,s=!0){this.hidden||this.opacity<=0||(s&&t.push(),this.transform(t),this.drawImage(t),s&&t.pop())}transform(t){t.translate(this.pos.x,this.pos.y),t.rotate(this.angle),t.scale((this.flipX?-1:1)*this._s.x,(this.flipY?-1:1)*this._s.y)}drawImage(t,s=!0){let i=this.anchor,r=-this.sprite.width*(this.flipX?1-i.x:i.x),o=-this.sprite.height*(this.flipY?1-i.y:i.y);s&&t.alpha(this.opacity),t.image(r,o,this.sprite)}};var G=(e,t)=>Math.abs(t-e)||0;var j=(e,t,s,i=Math.sin)=>e+(i(s)+1)/2*(t-e);var z=e=>e%1||0;var $=e=>Array.from(Array(e).keys());var q=advance=(e,t,s,i=1)=>{s&&(t.x+=s.x*i,t.y+=s.y*i),e.x+=t.x*i,e.y+=t.y*i};var m=Math.PI/2,Ht=(e,t,s,i=1,r=K)=>new S(e,t,s,i,r),K=e=>e,Ot=e=>e*e,Ct=e=>-e*(e-2),St=e=>e<.5?2*e*e:-2*e*e+4*e-1,kt=e=>e*e*e-e*Math.sin(e*Math.PI),Dt=e=>{let t=1-e;return 1-(t*t*t-t*Math.sin(t*Math.PI))},Pt=e=>{if(e<.5){let s=2*e;return .5*(s*s*s-s*Math.sin(s*Math.PI))}let t=1-(2*e-1);return .5*(1-(t*t*t-t*Math.sin(e*Math.PI)))+.5},Lt=e=>Math.sin(13*m*e)*Math.pow(2,10*(e-1)),Xt=e=>Math.sin(-13*m*(e+1))*Math.pow(2,-10*e)+1,Rt=e=>{if(e<.5){let i=Math.sin(13*m*(2*e)),r=Math.pow(2,10*(2*e-1));return .5*i*r}let t=Math.sin(-13*m*(2*e-1+1)),s=Math.pow(2,-10*(2*e-1));return .5*(t*s+2)},Z=e=>1-k(1-e),k=e=>e<4/11?121*e*e/16:e<8/11?363/40*e*e-99/10*e+17/5:e<9/10?4356/361*e*e-35442/1805*e+16061/1805:54/5*e*e-513/25*e+268/25,Yt=e=>e<.5?.5*Z(e*2):.5*k(e*2-1)+.5,S=class{running=!1;_o;_p;_x;_d;_e;_rel;_cb=[];_t=0;_u=0;_ch=this;_cu=this;_lc;constructor(t,s,i,r,o){this._o=t,this._p=s,this._x=i,this._d=r,this._e=o}start(t){this.running||this.stop(),this._cu.stop(!1),this._ch=this._cu=this;let s=this._o[this._p]||0,i=this._rel?s+this._x:this._x;return this._lc=this._lc||t||globalThis,this._u=this._lc.listen("update",r=>{this._o[this._p]=this._lc.lerp(s,i,this._e(this._t/this._d)),this._t+=r,this._t>=this._d&&(this._o[this._p]=i,this.stop())}),this.running=!0,this}onEnd(t){this._cb.push(t)}stop(t=!0){if(!(!this.running||!this._u)&&(this.running=!1,this._u(),this._t=0,t))for(let s of this._cb)s(this._o)}chain(t){return this._ch.onEnd(()=>{this._cu=t.start(this._lc)}),this._ch=t,this}reset(){this._cb.length=0,this.stop()}relative(t=!0){return this._rel=t,this}get current(){return this._cu}get progress(){return this.running?this._t/this._d:0}};globalThis.utils=Object.assign(globalThis.utils||{},D);})(); diff --git a/public/sw.js b/public/sw.js index 166461e..353c861 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,5 +1,5 @@ const cacheName = "luizbills.litecanvas-editor-v1"; -const version = "2.16.4"; +const version = "2.17.0"; const precacheResources = [ "/", diff --git a/public/tools/pixel-art-editor.html b/public/tools/pixel-art-editor.html index 0032b7b..4a75e84 100644 --- a/public/tools/pixel-art-editor.html +++ b/public/tools/pixel-art-editor.html @@ -145,7 +145,7 @@ @media (prefers-color-scheme: dark) { body { - background: #111; + background: #000; color: #fff; } @@ -236,7 +236,7 @@

litepixel

const $ = (selector) => document.querySelector(selector); // color palette const colors = [ - "#000", + "#111", "#6a7799", "#aec2c2", "#FFF1E8",