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

167
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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