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

166
Visualizações
Have a paper js file that can be imported as a module

I am making a game and I would like to have my code split into two files. One, an ordinary javascript file for the gameplay, the other a paperscript file for all the graphics. I want to call functions from the paperscript file from the main file, but as far as I can see it needs to be loaded with type="module" for me to be able to call functions, but it also needs to be loaded with type="text/paperscript" for it to work as paperscript. If there is annother way to call functions from a different file I would like to hear about it, or if there is a way to include both type="module" and type="text/paperscript" in the same script element.

If this is not possible I know I could use javascript not paperscript but I would rather not because all the examples I have seen are using paperscript

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

0

I've figured out how to do what I want and I feel very stupid now. I learned python and am new to javascript and didn't realise that you could just call functions from other files, in python you can only do this by using modules.

Here I can declare a variable as window.<myVariableName> in paperscript to be able to access it from raw javascript.

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