-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhButton.pde
More file actions
28 lines (23 loc) · 855 Bytes
/
Copy pathhButton.pde
File metadata and controls
28 lines (23 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*CLASE PARA LOS BOTONES DE HOBBIES*/
//Creo esta clase para poder crear instancias de títulos para cada uno de los hobbies, y así poder controlar mejor su funcionamiento
class hButton{
color c; //Color, para diferenciar cada uno
float xPos; //Para definir la posición en x
float yPos; //Para definir la posición en y
int textSize; //Para definir el tamaño de la fuente cuando hagamos hover
String text; //Para especificar el texto que se imprimirá en pantalla
//Constructor de la clase
hButton(color cArg, float xPosArg, float yPosArg, int textSizeArg, String textArg){
c = cArg;
xPos = xPosArg;
yPos = yPosArg;
textSize = textSizeArg;
text = textArg;
}
//Método para dibujar en pantalla cada hobbie
void display(){
fill(c);
textSize(textSize);
text(text, xPos, yPos);
};
};