Reputation: 478
i'm styling my javafx scene with css, and now i want to animate a text in a button on mouse hover. when i was reading similar questions here they say that it's not possible to do animation in css, and suggested to do animation in logic layer(clear, right?). anyway while i was searching IDE's suggestions, codes like:
animation-timing-function: ease-in;
where allowed, so it is possible.
my question is how to animate a text for example, using css. a sample code could be enough. I also read JavaFX CSS Reference Guide, but i got nothing.
Upvotes: 1
Views: 1597
Reputation: 159416
JavaFX 2.2 and JavaFX 8 have no support for animating text using css.
Your IDE is being misleading in suggesting the animation-timing-function
CSS attribute for use in a CSS file to be used only by JavaFX. Most HTML type CSS attributes are unsupported by JavaFX. JavaFX instead has its own CSS attribute definitions, usually prefixed by -fx-
. The set of supported CSS attributes for JavaFX is defined in the JavaFX CSS Reference Guide.
Note that you can load HTML into a JavaFX application via WebView and that HTML can make use of HTML CSS to perform animations on the HTML document displayed in the WebView (not the JavaFX SceneGraph), but that is probably not what you wish to do.
Upvotes: 3