samedi 28 février 2015

How to control .gif behavior in JavaFX?



I wanted to have quick animation of button when it is hovered. I created still picture for button and a gif, which animates only once(looping option:once). And I presumed that after button is hovered gif will play once and stop. But in reality animation is looping and if I hover button again gif will start not from the beginning, but from the same place where it stopped. Is there a way to make gif behave normally: start from the beginning when button is hovered and stop once animation ends?


CSS code for button:



.clock_button{
-fx-background-image: url("images/pink.png");}

.clock_button:hover{
-fx-background-image: url("images/pink_a.gif");}



Aucun commentaire:

Enregistrer un commentaire