# Screen with objects

**URL:** <https://discourse.processing.org/t/screen-with-objects/33683>\
**Category:** Coding Questions\
**Created:** [November 23, 2021, 2:38am UTC](https://discourse.processing.org/t/screen-with-objects/33683 "2021-11-23T02:38:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tati1202](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@tati1202](https://discourse.processing.org/u/tati1202)\
**Post date:** [November 23, 2021, 2:38am UTC](https://discourse.processing.org/t/screen-with-objects/33683/1 "2021-11-23T02:38:31Z")

</div>

Hi, why does the screen not change when I press the button?

> please format code with \</\> button \* [homework policy](https://discourse.processing.org/faq/#homework) \* [asking questions](https://discourse.processing.org/t/2147)
> 
> Class Pantalla {

int cant=57;  
Botoncito bot=new Botoncito[cant];  
Textos texto;  
PImage fotos;  
String pantalla;  
int x,y,wid,siz;

Pantalla(PImage fotosh) {  
fotos = fotosh;  
texto=new Textos();

```
for(int i=0;i<bot.length;i++){
 bot[i]=new Botoncito();  
  
}

```

}

void iniciarAventura(String pantalla) {  
if ( pantalla.equals(“inicio”) ) {  
inicio();  
} else if ( pantalla.equals(“vestuario”) ) {  
vestuario();  
} else if ( pantalla.equals(“vestuarioConfirmadoA”) ) {  
vestuarioConfirmadoA();  
} else if ( pantalla.equals(“vestuarioConfirmadoB”) ) {  
vestuarioConfirmadoB();  
} else if ( pantalla.equals(“contentosA”) ) {  
contentosA();  
} else if ( pantalla.equals(“confundidosA”) ) {  
confundidosA();  
} else if ( pantalla.equals(“contentosB”) ) {  
contentosB();  
} else if ( pantalla.equals(“confundidosB”) ) {  
confundidosB();  
} else if ( pantalla.equals(“arrancaA”) ) {  
arrancaA();  
} else if ( pantalla.equals(“arrancaB”) ) {  
arrancaB();  
} else if (pantalla.equals(“arrancaC”) ) {  
arrancaC();  
} else if (pantalla.equals(“arrancaD”) ) {  
arrancaD();  
} else if (pantalla.equals(“dudasA”) ) {  
dudasA();  
} else if (pantalla.equals(“golBrunoA”) ) {  
golBrunoA();  
} else if (pantalla.equals(“entreTiempoA2”) ) {  
entreTiempoA2();  
} else if (pantalla.equals(“golSanchoA”) ) {  
golSanchoA();  
} else if (pantalla.equals(“entreTiempoA”) ) {  
entreTiempoA();  
} else if (pantalla.equals(“dudasA2”) ) {  
dudasA2();  
} else if (pantalla.equals(“campeones”) ) {  
campeones();  
} else if (pantalla.equals(“golGreenwood”) ) {  
golGreenwood();  
} else if (pantalla.equals(“golBayernA”) ) {  
golBayernA();  
} else if (pantalla.equals(“golCr7A”) ) {  
golCr7A();  
} else if (pantalla.equals(“golPogba”) ) {  
golPogba();  
} else if (pantalla.equals(“golBayernA2”) ) {  
golBayernA2();  
} else if (pantalla.equals(“dudasA3”) ) {  
dudasA3();  
} else if (pantalla.equals(“golBayernA3”) ) {  
golBayernA3();  
} else if (pantalla.equals(“golBrunoA2”) ) {  
golBrunoA2();  
} else if (pantalla.equals(“derrota”) ) {  
derrota();  
} else if (pantalla.equals(“golBayernB”) ) {  
golBayernB();  
} else if (pantalla.equals(“entreTiempoB”) ) {  
entreTiempoB();  
} else if (pantalla.equals(“golSanchoB”) ) {  
golSanchoB();  
} else if (pantalla.equals(“golBayernB2”) ) {  
golBayernB2();  
} else if (pantalla.equals(“golCavaniB”) ) {  
golCavaniB();  
} else if (pantalla.equals(“golRashfordC”) ) {  
golRashfordC();  
} else if (pantalla.equals(“entreTiempoC”) ) {  
entreTiempoC();  
} else if (pantalla.equals(“golCr7C”) ) {  
golCr7C();  
} else if (pantalla.equals(“golBayernC”) ) {  
golBayernC();  
} else if (pantalla.equals(“dudasC”) ) {  
dudasC();  
} else if (pantalla.equals(“golCavaniC”) ) {  
golCavaniC();  
} else if (pantalla.equals(“golCr7C2”) ) {  
golCr7C2();  
} else if (pantalla.equals(“entreTiempoD”) ) {  
entreTiempoD();  
} else if (pantalla.equals(“golMaguire”) ) {  
golMaguire();  
} else if (pantalla.equals(“golBayernD”) ) {  
golBayernD();  
} else if (pantalla.equals(“golVarane”) ) {  
golVarane();  
} else if (pantalla.equals(“golBrunoD”) ) {  
golBrunoD();  
} else if (pantalla.equals(“creditos”) ) {  
creditos();  
} else if (pantalla.equals(“inicio”) ) {  
inicio();  
}  
}

// Cada pantalla tiene distintos comportamientos

void inicio() {  
image(fotos[0], 0, 0, width, height);  
bot[0].dibujar(340, 370, 120, 75); // Me manda a vestuario  
texto.dibujar(0, 24, 255, 350, 395, 100, 55);  
}

void vestuario() { // Vengo de inicio  
image(fotos[1], 0, 0, width, height);  
texto.dibujar(1, 24, 0, 30, 20, 600, 200);  
bot[1].dibujar(315, 350, 238, 50); // Equipo A ID 1 - Me manda a vestuarioConfirmadoA  
texto.dibujar(2, 24, 255, 330, 365, 200, 30); //SAPE  
bot[2].dibujar(555, 350, 230, 50); // Equipo B ID 2 - Me manda a vestuarioConfirmadoB  
texto.dibujar(3, 24, 255, 570, 365, 200, 30); //  
}

void vestuarioConfirmadoA() { // vengo de vestuario con el primer boton  
image(fotos[22], 0, 0, width, height); // Equipo A  
texto.dibujar(4, 24, 0, 10, 40, 300, 200); // “Los jugadores esperan unas palabras de tu parte”  
//bot(360, 350, 70, 50); // “Muchachos, esto es una final y hay que ganarla COMO SEA” - Me manda a contentosA  
bot[3].dibujar(315, 370, 238, 216);  
texto.dibujar(5, 24, 255, 330, 380, 200, 200);  
//bot(450, 350, 70, 50); // “Muchachos, no hay presión. Lo importante es divertirse” - Me manda a confundidosA  
bot[4].dibujar(555, 370, 238, 216);  
texto.dibujar(6, 24, 255, 570, 380, 200, 200);  
}

void vestuarioConfirmadoB() { // vengo de vestuario con el segundo boton  
image(fotos[22], 0, 0, width, height);  
texto.dibujar(4, 24, 0, 10, 40, 300, 200);  
bot[5].dibujar(315, 370, 238, 216); // “Muchachos, esto es una final y hay que ganarla COMO SEA” - Me manda a contentosB  
texto.dibujar(5, 24, 255, 330, 380, 200, 200);  
bot[6].dibujar(555, 370, 238, 216); // “Muchachos, no hay presión. Lo importante es divertirse” - Me manda a confundidosB  
texto.dibujar(6, 24, 255, 570, 380, 200, 200);  
}

void contentosA() { // Vengo de vestuarioConfirmadoA  
image(fotos[2], 0, 0, width, height);  
texto.dibujar(7, 24, 0, 10, 40, 300, 200); // “Los jugadores están felices, se quieren comer la cancha!”  
bot[7].dibujar(700, 550, 90, 30); // Me manda a arrancaA  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); //Continuar  
}

void contentosB() { // Vengo de vestuarioConfirmadoB  
image(fotos[2], 0, 0, width, height);  
texto.dibujar(7, 24, 0, 10, 40, 300, 200); // “Los jugadores están felices, se quieren comer la cancha!”  
bot[8].dibujar(700, 550, 90, 30); // Me manda a arrancaB  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); //Continuar  
}

void confundidosA() { // vengo de vestuarioConfirmadoA  
image(fotos[3], 0, 0, width, height);  
texto.dibujar(8, 24, 0, 10, 40, 300, 200); // “Los jugadores están confundidos, cómo vas a encarar así una final!!!”  
bot[9].dibujar(700, 550, 90, 30); // Me manda a arrancaC  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); //Continuar  
}

void confundidosB() { // vengo de vestuarioConfirmadoB  
image(fotos[3], 0, 0, width, height);  
texto.dibujar(8, 24, 0, 10, 40, 300, 200); // “Los jugadores están confundidos, cómo vas a encarar así una final!!!”  
bot[9].dibujar(700, 550, 90, 30); // Me manda a arrancaD  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); //Continuar  
}

void arrancaA() { // Vengo de contentosA  
image(fotos[6], 0, 0, width, height);  
texto.dibujar(9, 24, 255, 10, 40, 300, 200); // “Arranca el partido!!!”  
bot[10].dibujar(700, 550, 90, 30); // Me manda a dudasA  
texto.dibujar(59, 20, 255, 710, 555, 70, 30);  
}

void arrancaB() { // Vengo de confundidosA  
image(fotos[6], 0, 0, width, height);  
texto.dibujar(9, 24, 255, 10, 40, 300, 200); // “Arranca el partido!!!”  
bot[11].dibujar(700, 550, 90, 30); // Me manda a golBayernB  
texto.dibujar(59, 20, 255, 710, 555, 70, 30);  
}

void arrancaC() { // Vengo de contentosB  
image(fotos[6], 0, 0, width, height);  
texto.dibujar(9, 24, 255, 10, 40, 300, 200); // “Arranca el partido!!!”  
bot[12].dibujar(700, 550, 90, 30); // Me manda a golRashford  
texto.dibujar(59, 20, 255, 710, 555, 70, 30);  
}

void arrancaD() { // Vengo de confundidosB  
image(fotos[6], 0, 0, width, height);  
texto.dibujar(9, 24, 255, 10, 40, 300, 200); // “Arranca el partido!!!”  
bot[13].dibujar(700, 550, 90, 30); // Me manda a entretiempoA  
texto.dibujar(59, 20, 255, 710, 555, 70, 30);  
}

void dudasA() { // Vengo de arrancaA  
image(fotos[4], 0, 0, width, height);  
texto.dibujar(10, 24, 255, 10, 40, 300, 200); // “30´ Se lesiona Sancho, pero dice que puede seguir ¿Lo dejas o lo sacás?”  
bot[14].dibujar(100, 450, 100, 70); // Lo dejo - Me manda a golBrunoA  
texto.dibujar(11, 20, 255, 112, 475, 80, 50);  
bot[15].dibujar(600, 450, 100, 70); // Lo saco - Me manda a entreTiempoB  
texto.dibujar(12, 20, 255, 612, 475, 80, 50);  
}

void dudasA2() { //vengo de entreTiempoA  
image(fotos[4], 0, 0, width, height);  
texto.dibujar(18, 24, 255, 10, 40, 300, 200); // “70´ Sigue 2-0 el partido. Se vienen unos cambios?”  
bot[16].dibujar(100, 450, 100, 70); // Hago cambios - Me manda a golGreenwood  
texto.dibujar(19, 20, 255, 112, 465, 80, 50);  
bot[17].dibujar(600, 450, 100, 70); // No hago cambios - Me manda a golBayern  
texto.dibujar(20, 20, 255, 612, 465, 80, 50);  
}

void dudasA3() { //vengo de entreTiempoA2  
image(fotos[4], 0, 0, width, height);  
texto.dibujar(30, 24, 255, 10, 40, 300, 200); // “70´ Estás cagado, sos OLE, te pones a pensar si te tirás atrás o no, qué vas a hacer?”  
bot[18].dibujar(100, 450, 100, 70); // Me tiro atras - Me manda a gol de bayernA3  
texto.dibujar(31, 20, 255, 112, 465, 80, 50);  
bot[19].dibujar(600, 450, 100, 70); // Sigo así - Me manda a golBrunoA2  
texto.dibujar(32, 20, 255, 612, 465, 80, 50);  
}

void dudasC () { // vengo de golBayernC2  
image(fotos[4], 0, 0, width, height);  
texto.dibujar(45, 24, 255, 10, 40, 300, 200); // “79´ OTRO GOL DEL BAYERN HERMANO!? HACÉ ALGO!! METÉ UN CAMBIO!!! 1-2”  
bot[20].dibujar(100, 450, 100, 70); // “Hacer cambios” - Me manda a golCavaniC  
texto.dibujar(19, 20, 255, 112, 465, 80, 50);  
bot[21].dibujar(600, 450, 100, 70); // “No Hacer cambios” - Me manda a derrota  
texto.dibujar(20, 20, 255, 612, 465, 80, 50);  
}

void golBrunoA () { // Vengo de dudasA  
image(fotos[5], 0, 0, width, height);  
texto.dibujar(13, 24, 255, 10, 40, 300, 200); // “42´ GOOOOOOL de Bruno! Asistencia de Sancho!! MENOS MAL QUE NO LO SACASTE! 1-0”  
bot[22].dibujar(700, 550, 90, 30); // Boton continuar - Me manda a Gol de Sancho  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void golBrunoA2 () { //vengo de dudasA3  
image(fotos[7], 0, 0, width, height);  
texto.dibujar(29, 24, 255, 10, 40, 300, 200); //“65´ GOOOOOL de Brunoooo 1-0. Vamos United carajo.”  
bot[23].dibujar(700, 550, 90, 30); // Boton continuar - Me manda a campeon  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void golBrunoD () { //vengo de golVarane  
image(fotos[5], 0, 0, width, height);  
texto.dibujar(55, 24, 255, 10, 40, 300, 200); //“86´ GOOOOOOOL DE BRUNOOOOO, QUE LIQUIDA EL PARTIDO SOBRE EL FINAL, CUANTA CALIDAD DEL PORTUGUÉS MAGNIFICO!!! 3-0"”  
bot[24].dibujar(700, 550, 90, 30); // Boton continuar - Me manda a campeon  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void golBayernA() { // vengo de dudasA2  
image(fotos[18], 0, 0, width, height);  
texto.dibujar(24, 24, 255, 10, 40, 300, 200); //“78´ Gol del Bayern, 2-1. AYAYAYAY”  
bot[25].dibujar(700, 550, 90, 30); // Boton Continuar - Me manda a campeones  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void golBayernA2() { // vengo de entreTiempoA2  
image(fotos[18], 0, 0, width, height);  
texto.dibujar(28, 24, 255, 10, 40, 300, 200); //“56´ gol del Bayern. No le encontrás la vuelta. Querías a Sancho y lo sacaste. 1-0”  
bot[26].dibujar(700, 550, 90, 30); // Boton Continuar - me manda a derrota  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void golBayernA3() { // vengo de dudasA3  
image(fotos[18], 0, 0, width, height);  
texto.dibujar(33, 24, 255, 10, 40, 300, 200); //“90´ te empezaron a cagar a pelotazos por tirarte atrás y te lo ganan en la ultima. No aprendiste NADA, Ole.”  
bot[27].dibujar(700, 550, 90, 30); // Boton Continuar - me manda a derrota  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void golBayernB() { // vengo de arrancaB  
image(fotos[18], 0, 0, width, height);  
texto.dibujar(34, 24, 255, 10, 40, 300, 200); //“45´ gol del Bayern sobre el final del PT”  
bot[28].dibujar(700, 550, 90, 30); // Boton Continuar - me manda a entreTiempoB  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // CONTINUAR  
}

void golBayernB2() { // vengo de EntreTiempoB  
image(fotos[18], 0, 0, width, height);  
texto.dibujar(40, 24, 255, 10, 40, 300, 200); //“55´ Gol del Bayern. Se frustran todos. Pipo Gorosito es mejor que vos, Ole Gunnar. 2-0”  
bot[29].dibujar(700, 550, 90, 30); // Boton Continuar - me manda a derrota  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // CONTINUAR  
}

void golBayernC() { // vengo de entreTiempoC  
image(fotos[18], 0, 0, width, height);  
texto.dibujar(44, 24, 255, 10, 40, 300, 200); //“77´ gol del Bayern. Te lo empataron por salame. 1-1”  
bot[30].dibujar(700, 550, 90, 30); // Boton Continuar - Me manda a dudasC  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // CONTINUAR  
}

void golBayernD() { // vengo de entreTiempoD  
image(fotos[18], 0, 0, width, height);  
texto.dibujar(56, 24, 255, 10, 40, 300, 200); //“93´ gol del Bayern. No jugaron a nada y mañana te quedás sin laburo. Lamentable. 0-1”  
bot[31].dibujar(700, 550, 90, 30); // Boton Continuar - Me manda a derrota  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void golSanchoA() { // vengo de golBrunoA  
image(fotos[9], 0, 0, width, height);  
texto.dibujar(14, 24, 255, 10, 40, 300, 200); // Gol de Sancho etc etc  
bot[32].dibujar(700, 550, 90, 30); // Boton Continuar - me manda a Entre tiempo  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void golSanchoB() { // vengo de entreTiempoB  
image(fotos[12], 0, 0, width, height);  
texto.dibujar(38, 24, 255, 10, 40, 300, 200); // “55´ GOOOOL, Sancho pone el empate 1-1! Dale que se puede”  
bot[33].dibujar(700, 550, 90, 30); // Me manda a GolCavaniB  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void golCavaniB() { // vengo de golSanchoB  
image(fotos[19], 0, 0, width, height);  
texto.dibujar(39, 24, 255, 10, 40, 300, 200); // “90+2´ GOOOOOOOOOOOOOOOL CAVANI METE TERRIBLE CABEZAZO PARA GANAR SOBRE EL FINAL!!! MATADOOOR MATADOOOR!!!”  
bot[34].dibujar(700, 550, 90, 30); // Me manda a campeones  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void golCavaniC() { // vengo de dudasC  
image(fotos[17], 0, 0, width, height);  
texto.dibujar(48, 24, 255, 10, 40, 300, 200); // “85´ EMPATA CAVANI DE PALOMITA. NO SE PIERDE LA ESPERANZA. 2-2”  
bot[35].dibujar(700, 550, 90, 30); // CONTINUAR - Me manda a golCr7C2  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void entreTiempoA() { //Vengo de dudasA  
image(fotos[22], 0, 0, width, height);  
texto.dibujar(15, 24, 0, 10, 40, 300, 200); // “Entre tiempo, te vas al vestuario, todos esperan una arenga tuya”  
bot[36].dibujar(315, 370, 238, 216); // Arenga - Me manda a dudasA2  
texto.dibujar(16, 24, 255, 330, 380, 200, 200);  
bot[37].dibujar(555, 370, 238, 216); // Conformismo - Me manda a campeones  
texto.dibujar(17, 24, 255, 570, 380, 200, 200);  
}

void entreTiempoA2() { //Vengo de dudasA  
image(fotos[22], 0, 0, width, height);  
texto.dibujar(25, 24, 0, 10, 40, 300, 200); // “Te vas al vestuario con los jugadores, elegis dar una charla motivacional o te lamentas por la salida de Sancho”  
bot[38].dibujar(315, 370, 238, 216); // Lamento - Me manda a golBayernA2  
texto.dibujar(27, 24, 255, 330, 380, 200, 200);  
bot[39].dibujar(555, 370, 238, 216); // Motivacion - Me manda a dudasA3  
texto.dibujar(26, 24, 255, 570, 380, 200, 200);  
}

void entreTiempoB () { // vengo de golBayernB  
image(fotos[22], 0, 0, width, height);  
texto.dibujar(35, 24, 0, 10, 40, 300, 200); // //“Estas en el vestuario, entre tiempo, les decis que pongan mas huevos o les decis que sigan igual?”  
bot[40].dibujar(315, 370, 238, 216); // Huevo Huevo - Me manda a golSanchoB  
texto.dibujar(36, 24, 255, 330, 380, 200, 200);  
bot[41].dibujar(555, 370, 238, 216); // Sigan asi - Me manda a golBayernB2  
texto.dibujar(37, 24, 255, 570, 380, 200, 200);  
}

void entreTiempoC() {  
image(fotos[22], 0, 0, width, height);  
texto.dibujar(42, 24, 0, 10, 40, 300, 200); // “Entre tiempo, les decis que NO se relajen o los felicitas?”  
bot[42].dibujar(315, 370, 238, 216); // “No se relajen” - Me manda a golCr7C  
texto.dibujar(60, 24, 255, 330, 380, 200, 200);  
bot[43].dibujar(555, 370, 238, 216); // “Felicitar” - Me manda a golBayernC  
texto.dibujar(61, 24, 255, 570, 380, 200, 200);  
}

void entreTiempoD() { // Vengo de dudasD  
image(fotos[22], 0, 0, width, height);  
texto.dibujar(50, 24, 0, 10, 40, 300, 200 ); // “Te vas al vestuario. Aburridisimo 0-0 al entre tiempo. No sabes que hacer. Admitis que te equivocaste y que hay que ganar como sea?”  
bot[44].dibujar(315, 370, 238, 216); // “Admitir Error” - me manda a golMaguire  
texto.dibujar(51, 24, 255, 330, 380, 200, 200);  
bot[45].dibujar(555, 370, 238, 216); // “Pedir sonrisas” - me manda a golBayernD  
texto.dibujar(52, 24, 255, 570, 380, 200, 200);  
}

void golRashfordC() {  
image(fotos[14], 0, 0, width, height);  
texto.dibujar(41, 24, 255, 10, 40, 300, 200); //“40´ GOOOL DE RASHFORD A LA CONTRA. 1-0”  
bot[46].dibujar(700, 550, 90, 30); // Boton Continuar - Me manda a Entre tiempo  
texto.dibujar(59, 20, 255, 710, 555, 70, 30);  
}

void golGreenwood() { // vengo de dudasA2  
image(fotos[13], 0, 0, width, height);  
texto.dibujar(21, 24, 255, 10, 40, 300, 200); //“71´ GOOOOOL de Greenwood RECIÉN ingresado!!! Qué pasó Ole??? Aprendiste a hacer cambios!!! BIEEEEN!!! 3-0.”  
bot[47].dibujar(700, 550, 90, 30); // me manda a GolCr7  
texto.dibujar(59, 20, 255, 710, 555, 70, 30);  
}

void golCr7A() { // vengo de golGreenwood  
image(fotos[8], 0, 0, width, height);  
texto.dibujar(22, 24, 255, 10, 40, 300, 200);  
bot[48].dibujar(700, 550, 90, 30); // me manda a GolPogba  
texto.dibujar(59, 20, 255, 710, 555, 70, 30);  
}

void golCr7C() { // vengo de entreTiempoC  
image(fotos[10], 0, 0, width, height);  
texto.dibujar(43, 24, 255, 10, 40, 300, 200); //“88´ GOOLAAAAAZOOOOO DEL BICHO, CR7 IDOLO, MÁQUINA, PONE EL 2-0 SOBRE EL FINAL DEL PARTIDO, VAMOS UNITED. 2-0”  
bot[49].dibujar(700, 550, 90, 30); // me manda a campeones  
texto.dibujar(59, 20, 255, 710, 555, 70, 30);  
}

void golCr7C2() { // vengo de golCavaniC  
image(fotos[11], 0, 0, width, height);  
texto.dibujar(49, 24, 255, 10, 40, 300, 200); //“90+3´ GOOOOOL DE CRISTIANO RONALDO, QUE LE DA LA 4TA CHAMPIONS AL CLUB QUE LO VIÓ NACER!! TE SALIERON LOS CAMBIOS, OLE!! 3-2”  
bot[50].dibujar(700, 550, 90, 30); // me manda a campeones  
texto.dibujar(59, 20, 255, 710, 555, 70, 30);  
}

void golPogba() { // vengo de golCr7A  
image(fotos[20], 0, 0, width, height);  
texto.dibujar(23, 24, 255, 10, 40, 300, 200);  
bot[51].dibujar(700, 550, 90, 30); // me manda a campeones  
texto.dibujar(59, 20, 255, 710, 555, 70, 30);  
}

void golMaguire() { // vengo de entreTiempoD  
image(fotos[15], 0, 0, width, height);  
texto.dibujar(53, 24, 255, 10, 40, 300, 200); // “63´ GOL DE MAGUIRE HACIENDO VALER SU 1.94 DE ALTURA. 1-0.”  
bot[52].dibujar(700, 550, 90, 30); // Me manda a golVarane  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void golVarane() { // vengo de golMaguire  
image(fotos[16], 0, 0, width, height);  
texto.dibujar(54, 24, 255, 10, 40, 300, 200); // “75´ GOL DEL OTRO CENTRAL, GOL DE VARANE. EXCELENTE PELOTA PARADA DEL UNITED. 2-0”  
bot[53].dibujar(700, 550, 90, 30); // Me manda a golBrunoD  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void campeones() {  
image(fotos[21], 0, 0, width, height);  
texto.dibujar(57, 24, 255, 10, 40, 500, 200);  
bot[54].dibujar(700, 550, 90, 30); // Boton para reiniciar - Me manda a los créditos  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void derrota() {  
image(fotos[23], 0, 0, width, height);  
texto.dibujar(58, 24, 255, 10, 40, 500, 200); // “Final del partido. Bayern campeón. Che, Ole, acá a la vuelta en la carnicería andan tomando CVs.”  
bot[55].dibujar(700, 550, 90, 30); // Boton para reiniciar - Me manda a los créditos  
texto.dibujar(59, 20, 255, 710, 555, 70, 30); // Continuar (texto)  
}

void creditos() {  
background(0);  
textAlign(CENTER, CENTER);  
textSize(36);  
float col;  
float colB;  
float colC;  
col = random(0, 255);  
colB = random(0, 255);  
colC = random(0, 255);  
fill(col, colB, colC);  
text(“Gonzalo Castro Ediola//Juan Bautista Felli”, 400, 220);  
textSize(26);  
text(“Legajo 88125/0”, 400, 260);  
text(“Tecno 1 Comisión 2”, 400, 300);  
text(“Año 2021”, 400, 340);  
bot[56].dibujar(700, 550, 90, 30); // Boton para reiniciar - Me manda al inicio  
textAlign(CENTER);  
fill(255);  
textSize(20);  
text(“Reiniciar”, 710, 555, 70, 30);  
}

void mousePressed() {

```
if (bot[0].getBotonPressed(mouseX, mouseY, 340, 370, 120, 75) && pantalla.equals("inicio")) { 
  pantalla = "vestuario";
} else if (bot[1].getBotonPressed(mouseX, mouseY, 315, 350, 238, 50) && pantalla.equals("vestuario")) {
  pantalla = "vestuarioConfirmadoA";/*
} else if (bot.getBotonPressed(mouseX, mouseY, 555, 350, 230, 50 ) && pantalla.equals("vestuario")) {  
  pantalla = "vestuarioConfirmadoB";
} else if (bot.getBotonPressed(mouseX, mouseY, 315, 370, 238, 216) && pantalla.equals("vestuarioConfirmadoA")) { 
  pantalla = "contentosA";
} else if (bot.getBotonPressed(mouseX, mouseY, 555, 370, 238, 216 ) && pantalla.equals("vestuarioConfirmadoA")) {
  pantalla = "confundidosA";
} else if (bot.getBotonPressed(mouseX, mouseY, 315, 370, 238, 216 ) && pantalla.equals("vestuarioConfirmadoB")) {
  pantalla = "contentosB";
} else if (bot.getBotonPressed(mouseX, mouseY, 555, 370, 238, 216 ) && pantalla.equals("vestuarioConfirmadoB")) { 
  pantalla = "confundidosB";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("contentosA")) {
  pantalla = "arrancaA";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("confundidosA")) {  
  pantalla = "arrancaB";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("contentosB")) { 
  pantalla = "arrancaC";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("confundidosB") ) { 
  pantalla = "arrancaD";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("arrancaA") ) {
  pantalla = "dudasA";
} else if (bot.getBotonPressed(mouseX, mouseY, 100, 450, 100, 70 ) && pantalla.equals("dudasA") ) {
  pantalla = "golBrunoA";
} else if (bot.getBotonPressed(mouseX, mouseY, 600, 450, 100, 70 ) && pantalla.equals("dudasA") ) {
  pantalla = "entreTiempoA2";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golBrunoA") ) {
  pantalla = "golSanchoA";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golSanchoA") ) {
  pantalla = "entreTiempoA";
} else if (bot.getBotonPressed(mouseX, mouseY, 315, 370, 238, 216 ) && pantalla.equals("entreTiempoA") ) {
  pantalla = "dudasA2";
} else if (bot.getBotonPressed(mouseX, mouseY, 555, 370, 238, 216 ) && pantalla.equals("entreTiempoA") ) {
  pantalla = "campeones";
} else if (bot.getBotonPressed(mouseX, mouseY, 100, 450, 100, 70 ) && pantalla.equals("dudasA2") ) {
  pantalla = "golGreenwood";
} else if (bot.getBotonPressed(mouseX, mouseY, 600, 450, 100, 70 ) && pantalla.equals("dudasA2") ) {
  pantalla = "golBayernA";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golGreenwood") ) {
  pantalla = "golCr7A";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golCr7A") ) {
  pantalla = "golPogba";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golPogba") ) {
  pantalla = "campeones";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golBayernA") ) {
  pantalla = "campeones";
} else if (bot.getBotonPressed(mouseX, mouseY, 315, 370, 238, 216 ) && pantalla.equals("entreTiempoA2") ) {
  pantalla = "golBayernA2";
} else if (bot.getBotonPressed(mouseX, mouseY, 555, 370, 238, 216 ) && pantalla.equals("entreTiempoA2") ) {
  pantalla = "dudasA3"; //
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golBayernA2") ) {
  pantalla = "derrota";
} else if (bot.getBotonPressed(mouseX, mouseY, 100, 450, 100, 70 ) && pantalla.equals("dudasA3") ) {
  pantalla = "golBayernA3";
} else if (bot.getBotonPressed(mouseX, mouseY, 600, 450, 100, 70 ) && pantalla.equals("dudasA3") ) {
  pantalla = "golBrunoA2";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golBayernA3") ) {
  pantalla = "derrota";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golBrunoA2") ) {
  pantalla = "campeones";
  // FIN RAMA A
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("arrancaB") ) {
  pantalla = "golBayernB";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golBayernB") ) {
  pantalla = "entreTiempoB";
} else if (bot.getBotonPressed(mouseX, mouseY, 315, 370, 238, 216 ) && pantalla.equals("entreTiempoB") ) {
  pantalla = "golSanchoB";
} else if (bot.getBotonPressed(mouseX, mouseY, 555, 370, 238, 216 ) && pantalla.equals("entreTiempoB") ) {
  pantalla = "golBayernB2";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golSanchoB") ) {
  pantalla = "golCavaniB";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golBayernB2") ) {
  pantalla = "derrota";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golCavaniB") ) {
  pantalla = "campeones";
  // FIN RAMA B
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("arrancaC") ) {
  pantalla = "golRashfordC";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golRashfordC") ) {
  pantalla = "entreTiempoC";
} else if (bot.getBotonPressed(mouseX, mouseY, 315, 370, 238, 216 ) && pantalla.equals("entreTiempoC") ) {
  pantalla = "golCr7C";
} else if (bot.getBotonPressed(mouseX, mouseY, 555, 370, 238, 216 ) && pantalla.equals("entreTiempoC") ) {
  pantalla = "golBayernC";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golCr7C") ) {
  pantalla = "campeones";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golBayernC") ) {
  pantalla = "dudasC";
} else if (bot.getBotonPressed(mouseX, mouseY, 100, 450, 100, 70 ) && pantalla.equals("dudasC") ) {
  pantalla = "golCavaniC";
} else if (bot.getBotonPressed(mouseX, mouseY, 600, 450, 100, 70 ) && pantalla.equals("dudasC") ) {
  pantalla = "derrota";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golCavaniC") ) {
  pantalla = "golCr7C2";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golCr7C2") ) {
  pantalla = "campeones";
  //FIN RAMA C
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("arrancaD") ) {
  pantalla = "entreTiempoD";
} else if (bot.getBotonPressed(mouseX, mouseY, 315, 370, 238, 216 ) && pantalla.equals("entreTiempoD") ) {
  pantalla = "golMaguire";
} else if (bot.getBotonPressed(mouseX, mouseY, 555, 370, 238, 216 ) && pantalla.equals("entreTiempoD") ) {
  pantalla = "golBayernD";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golMaguire") ) {
  pantalla = "golVarane";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golVarane") ) {
  pantalla = "golBrunoD";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golBrunoD") ) {
  pantalla = "campeones";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("golBayernD") ) {
  pantalla = "derrota";
  //FIN RAMA D
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("derrota") ) {
  pantalla = "creditos";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("campeones")) {
  pantalla = "creditos";
} else if (bot.getBotonPressed(mouseX, mouseY, 700, 550, 90, 30 ) && pantalla.equals("creditos") ) {
  pantalla = "inicio";
}*/

```

}

}

}

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 23, 2021, 1:08pm UTC](https://discourse.processing.org/t/screen-with-objects/33683/2 "2021-11-23T13:08:08Z")

</div>

Gol Bayern!

is this your entire sketch?

mousePressed() inside the class won’t be called.

you need to have the real mousePressed() outside the class and call the mousePressed() inside the class:

void mousePressed() {  
pantalla.mousePressed();  
}

when you have many pantalla ( I don’t know what it is) call all of them.

**setup () and draw()**

you need setup () and draw() in your sketch.

e.g.

```auto

void setup() {
  size(880,880); 
}

void draw() {
  //
}

```

**see**

see section “Hello mouse” in [https://processing.org/tutorials/overview](https://processing.org/tutorials/overview)

(we can’t run the code since we don’t have the classes)

---

<div class="post-metadata">

**Author:** ![tati1202](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@tati1202](https://discourse.processing.org/u/tati1202)\
**Post date:** [November 29, 2021, 1:45pm UTC](https://discourse.processing.org/t/screen-with-objects/33683/3 "2021-11-29T13:45:30Z")

</div>

Hi, it´s not my entire sketch, if u wanna take a look it’s here [GitHub - GonzaCastro24/tecnomultimedia at tp6](https://github.com/GonzaCastro24/tecnomultimedia/tree/tp6)
