Actually a class would work here better. I think you want to have a tile that when you click you see the image?
Since you mention OOP in your first post, this is my suggestion, a pseudo-code:
class Tile{
//Memeber variables
PImage img;
String name;
boolean showImage; //True show picture, else show text
Tile(String aName, PImage anImg){
name=aName;
img=anImg;
showImage=false;
}
void display(){
if(showImage) displayImage();
else showName();
}
void displayImage(){
... To be implemented
}
void displayName(){
... To be implemented
}
}
Notice this class is the backbone. When you work in your implementation, you will notice that you need some sort of coordinates and fields to show either the image or the text. For instance: text(name,posX,posY);. Now, since you are working with OOP concepts, where and when would you define those fields like posX, posY and possibly the width and the height of the displaying area of these elements? (This is for you to consider)
Related to management of name/images, if you are using a fix number of name/image pairs, then you could use an array. Otherwise, use a list container like an ArrayList.
final int N=10;
Tile[] myTiles;
void setup(){
size(300,300);
myTiles=new Tile[N];
myTiles[0]=new Tile("name", loadImage("your image location.jpg"));
myTiles[1]=... etc.
...
}
Kf