Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!