Okay!!
You are not using w and h in the class. It’s only used in setup (). So you don’t have to pass w and h to the class and get rid of it in the class too.
Then inside the class you could have a mouse over effect so that the rect highlights when mouse is over without pressing it (hover)