void rectWithText(float rectX, float rectY, float rectWidth, float rectHeight, String rectText, float ts) { // rect rectMode(CENTER); rect(rectX, rectY, rectWidth, rectHeight); // text textSize(ts); textAlign(CENTER,CENTER); fill(0); text(rectText, rectX, rectY); // stop painting noFill(); } void menu() { rectWithText(width/2, height/2, 100, 50, "test", 40); } // This is basically the Level file: // It consists out of an array, that spawns tiles // It is also checked in collisionTest() int[] tiles_x = { 300, 50, 600, 50}; int[] tiles_y = { 500, 50, 600, 200 };