Is possible Encapsulate a Function in Processing?

Hi @Tibiscenas,

Yes it’s possible, you need to create a Java library and package it so it can be imported in another Java project.

One possible way to do this is to use Gradle:

https://docs.gradle.org/current/samples/sample_building_java_libraries.html

Note: you can’t just package a single function. Behind the scenes the Processing IDE wraps your code inside a class that has the methods setup, draw and your custom methods. :wink: