Displaying an Image N times
in
Programming Questions
•
1 year ago
I have this challenge. I am trying to display the same image in n locations at the same time.
In this case, im looking at placing it at five different location on my Sketch.This is what i have so far. I guess i have to increment the Value of x and y somewhere, but i dont know where.
In this case, im looking at placing it at five different location on my Sketch.This is what i have so far. I guess i have to increment the Value of x and y somewhere, but i dont know where.
- ...
- setup(){
- x = 90;
- y = 90;
- }
- void draw(){
- PlaceImages();
- }
- public void PlaceImages() {
int randomImage = (int)random(1, 23);
PImage loadedImage;
String imagePath = "shape/1.png";
loadedImage = loadImage(imagePath);
for (int i = 0; i<=5; i++) {
image(loadedImage, x, y);
}
}
1