Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

122
Visualizações
Trying to add specific size for each image in the folder in config.js

Im trying to generate images using coding in visual studio code. I want to add specific size for each image in each folder. for example I put this code below to show you what i mean. the code that I wrote below for example is taking the image Cigar.png from the folder 6-mouth and specifying its size and position, the same for other codes.

      {
        id: 0,
        name: "Cigar",
        path: `${dir}/6-mouth/Cigar.png`,
        weight: 46,
        position: { x: 331, y: 254 },
        size: { width: 76, height: 115 },
      },
      {
        id: 1,
        name: "Cigarette",
        path: `${dir}/6-mouth/Cigarette.png`,
        weight: 45,
        position: { x: 346, y: 326 },
        size: { width: 80, height: 24 },
      },
      {
        id: 2,
        name: "Gum",
        path: `${dir}/6-mouth/Gum.png`,
        weight: 44,
        position: { x: 352, y: 274 },
        size: { width: 139, height: 115 },
      },
      {
        id: 3,
        name: "Pipe",
        path: `${dir}/6-mouth/Pipe.png`,
        weight: 43,
        position: { x: 346, y: 262 },
        size: { width: 100, height: 172 },
      },

    it show me this after typing node index.js in terminal.

    // C:\Users\RobotiC\Desktop\index.js:80
    //  _element.layer.position.x,
    // TypeError: Cannot read properties of undefined (reading 'x')
    // at drawElement (C:\Users\RobotiC\Desktop\index.js:80:29)
    // at C:\Users\RobotiC\Desktop\index.js:161:11
    //  at Array.forEach (<anonymous>)
    //  at C:\Users\RobotiC\Desktop\\index.js:160:22
    //  at async startCreating (C:\Users\RobotiC\Desktop\index.js:157:7)
    // Node.js v17.7.2
    
    // how can i fix it 
    
    // Thanks
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda