How to create a opening flap or opening window?

Hello everyone, I’m stuck in a project right now and I wanted to create a flap that’ll reveal some images underneath.

It’s supposed to open when the user hovers is mouse on it yet I don’t know where and how to start.

Hi, To get a better understanding, can you post a picture or video of what you hope to create? Or can you describe in more detail about your project Please?

I don’t really have a video but I want to recreate a sort of miniature doll house that when a user clicks on a labelled part (e.g. bathroom) it opens up to reveal that room.

This is what I have so far. It’s still in progress and there’s no fill color for the objects so that I could see the coordinates.


1 Like

Start by drawing something. For example a circle:

void setup(){

void draw(){

Now you have something to cover up. Try drawing a rectangle that covers the circle.

When you have done that you essentally have what you want. All you need now is to find a way to make the rectangle dissappear when the mouse is over the rectangle. Maybe you can use an if statement and the mouseX and mouseY variables? Chekc it out in the reference if you are not familiar with the functions

1 Like