i'm trying to make a login screen for my card game project where the user can select the card he wants to get. i'm doing this by creating cards from a class Card which extends Rectangle and calls the superclass' constructor. Then, i add the created cards for the user to choose to an HBox and give them an ID. The idea is that, when the user hovers over or clicks on one of the cards (children of HBox), the card changes opacity to let the user know they did something. The problem is...it's not working.
From the LoginScreen class:
//filling the HBox up with a number of cards based on the amount of players
for(int dezeKaart = 0; dezeKaart < lijstVanBeschikbareKleuren.size(); dezeKaart++){
KleurKaart dezeKleur = new KleurKaart(lijstVanBeschikbareKleuren.get(dezeKaart));
kiesKleurKaartBox.getChildren().add(dezeKleur);
dezeKleur.setId("kleurKiezer");
}
from the CSS class:
#kleurKiezer {
-fx-opacity: 5.0;
-fx-border-width: 0 ;
}
the hover one:
#kleurKiezer:hover{
-fx-opacity: 1.0;
-fx-border-width: 5 ;
-fx-border-color: #FF847C;
}