contact.cjs 974 B

1234
  1. const fs=require('fs'),path=require('path');
  2. const sharp=require('C:/Users/EDY/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/node_modules/sharp');
  3. const root=path.resolve(__dirname,'../..');
  4. (async()=>{const dir=path.join(root,'Assets/BuffaloSiege/Art');const files=fs.readdirSync(dir).filter(n=>/^(avatar|prop|enemy)\..*\.png$/.test(n));const cells=[];for(let i=0;i<files.length;i++){const x=i%5*220,y=Math.floor(i/5)*240;const tile=await sharp(path.join(dir,files[i])).resize(200,200,{fit:'contain',background:{r:0,g:0,b:0,alpha:0}}).png().toBuffer();cells.push({input:tile,left:x+10,top:y+26});cells.push({input:Buffer.from(`<svg width="220" height="24"><text x="8" y="18" fill="#fff" font-family="Arial" font-size="15">${files[i]}</text></svg>`),left:x,top:y});}await sharp({create:{width:1100,height:Math.ceil(files.length/5)*240,channels:4,background:'#533e50'}}).composite(cells).png().toFile(path.join(__dirname,process.argv[2]||'before.png'));})();