Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 941

Loading SVG file in Android Studio

$
0
0

So, here is how this nightmare of mine goes. I am using Android Studio, using Processing, I get to create sketches without a problem, everything great. The problem is when in one of my sketches I try to load a file, an SVG file in order to create a PShape, the app doesn't know where the "data" folder is, and the problem is, I don't know where should I locate such folder or how to targer the file within my code. Thanks a lot.

 import processing.core.PApplet;
import processing.core.PShape;
import processing.core.PVector;

public class Menu extends PApplet {
    /**************************************************/
    //icon:
    PShape icon;

    /**************************************************/
    public void settings()
    {
        size(displayHeight, displayHeight);
    }
    /**************************************************/
    public void setup()
    {
        icon =  loadShape("menu.svg");  //here is where an error occurs;
    }
    /**************************************************/
    public void draw()
    {
        background(0);
    }
    /**************************************************/

Viewing all articles
Browse latest Browse all 941

Trending Articles