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

75
Vistas
p5.js múltiples lienzos y alcance de entrada/salida

Tengo un método de clase personalizado que no está definido, tal vez alguien pueda explicar por qué:

Aquí está la estructura de mi boceto:

//variables globales

 let cx = 0; . . . let cy = 0; class Dot(){ constructor(xps,ypos,col){ .... } over(mx,my){ .... } //some more functions } //canvas def and inst let inputSketch = function(){ isktch.setup = function(){ let inputCanvas = isktch.createCanvas(250,600); inputCanvas.position(0,0); isktch.background(245,245,240); } isktch.draw = function(){ .... } //some other functions } let inputSection = new p5(curveSketch,'inputSketch'); //Another canvas let curveSketch = function(){ curveSketch.setup = function(){ let curveCanvas = curveSketch.createCanvas(250,600); curveCanvas.position(0,0); curveSketch.background(245,245,240); } curveCanvas.draw = function(){ .... } //some other functions } let curveSection = new p5(curveSketch,'curveSketch'); //some global functions .... function editPoints(){ console.log("edit points"); let p = inputSection.getCurvePoints(); curveSection.editPointsArr = []; for (var i = 0 ; i<p.length ; i++){ if (p[i].x >=0){ let dot = new Dot(p[i].x,p[i].y,curveSketch.color(255,77,77)); dot.over(curveSection.mouseX,curveSection.mouseY); dot.update(curveSection.mouseX,curveSection.mouseY); dot.display(curveSection); curveSection.editPointsArr[i] = dot; } } curveSection.showPoints = true; }

entonces en esta función editPoints acepta let dot = new Dot(p[i].x,p[i].y,curveSection.color(255,77,77)); pero cuando llamo me sale un error indefinido: TypeError: No se pueden leer las propiedades de indefinido (leyendo 'sobre') Traté de ingresar solo números sobre (40,50) - pero aún recibo este error ¿Qué hago mal, me encantaría? para obtener un consejo ya que estoy apilado como el infierno. Gracias por adelantado :)

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