Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda