Importing assets when using Processing in another IDE

Hi everyone,

I wanted to know where do I need to place the data files ( like ttf, png etc) if I’m using processing with another IDE. I’ve setup gradle as the build system and am using intellij to code.

1 Like

Hi! I have them like this:

CurrentProject.iml
data/ *.jpg *.png *.ttf *.frag *.vert
src/com/hamoid/ *.java
1 Like

I think the most simple way would be to first write a line in your code that prints the path, like this: println(dataPath(""));, observe the result, and use that.

1 Like

I think that @Architector_4 best idea (prefer absolute paths in java) except:-

println(dataPath(""));

Expects a string input. I encountered problems with ruby-processing and JRubyArt, so developed a data_path wrapper to return absolute path (using ruby).

1 Like

Oh, yes, right. I’ll correct my original comment.

Also, if that doesn’t prove too useful, you could also try
println(dataFile("").getAbsolutePath());
or
try{println(dataFile("").getCanonicalPath());}catch(IOException e){}

You know, in case you want to have 3 different ways to do the same thing, each more complex than the last one. :v

2 Likes