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

171
Visualizações
Function can't be displayed in second canvas within p5.js

I created two separate canvases with p5.js by creating a new instance (see line 58 in my javascript file). Then I inserted a function called "firstAnimation" that will be displayed in one of the canvases.

Run the code here --> https://editor.p5js.org/MaximilianFreitag/sketches/fP46XAHnP

In line 45 of my javascript file p5.js is telling me that my function "secondAnimation" does not exist. So I can not output another animation in this canvas

In line 49 I can still draw a circle inside the second canvas with sketch.circle(100,100,100).

How can I display my second function in the second canvas so that I have two animations?

enter image description here

I can only add a simple circle

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You nead to specify where to draw a line. in second function just add myp5.line and just run function secondAnimation() without sketch.

about 4 years ago · Juan Pablo Isaza Relatório
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