Image merging question
in
Programming Questions
•
10 months ago
Hey, I would like to add two images like layers on top of each other and then store this into an image like so:
- int helmetLevel=0;
- PImage player=new PImage;
- PImage skeleton= new PImage;
- PImage[] helmet = new PImage;
- skeleton = loadImage("skeleton.png");
- helmet[0]= loadImage("transparent.png");
- helmet[1]= loadImage("helmet1.png");
- helmet[2]= loadImage("helmet2.png");
- player=(skeleton+helmet[helmetLevel]); //----does not work
- void updPlayer(){
- player=(skeleton+helmet[helmetLevel]); //----does not work
- }
So that i can change the helmet by changing helmetLevel and running updPlayer().
But player=(skeleton+helmet[]) does not work, so how do I blend two images together like this?
Thanks :)
1