Import from Processing to Eclipse - Problem with showing images.
in
Integration and Hardware
•
1 year ago
Hello out there,
if got a problem. I imported my exported code form processing into eclipse. So i´ve got one file with all my classes and code. I add the core.jar and so on... At first the programm starts perfect. But if i want to split my classes of the file in separeted classes in eclipse the images of the seperated classes doenst work.
I´ve added all the used images into the "src"-section.
i tryed to call the images in the following ways:
- import processing.core.PApplet;
- import processing.core.PImage;
- import processing.core.PVector;
-
- class cUpgrades {
-
- static protected PApplet proc;
-
- private PImage cUpWeapon;
- void setup() {
- cUpWeapon = proc.loadImage("cUpWeapon.png");
- }
-
- public void createcUpgrades () {
- proc.fill(0, 255, 0);
- proc.image(cUpWeapon, posUP.x, posUP.y);
- }
- }
-
- -------Second try------------------------------------------------
-
- import processing.core.PApplet;
- import processing.core.PImage;
- import processing.core.PVector;
-
- class cUpgrades {
-
- static protected PApplet proc;
-
- private PImage cUpHealth = proc.loadImage("cUpHealth.png");
-
- public void createcUpgrades () {
- proc.fill(0, 255, 0);
- proc.image(cUpWeapon, posUP.x, posUP.y);
- }
- }
1