Java Code Examples for javafx.animation.ScaleTransition#setByY()
The following examples show how to use
javafx.animation.ScaleTransition#setByY() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GameView.java From CrazyAlpha with GNU General Public License v2.0 | 5 votes |
public static void makeScaleTransition(Node node, int millis, double byX, double byY) { ScaleTransition st = new ScaleTransition(Duration.millis(millis)); st.setByX(byX); st.setByY(byY); st.setCycleCount(Animation.INDEFINITE); st.setAutoReverse(true); st.setNode(node); st.play(); }
Example 2
Source File: InternalWindow.java From desktoppanefx with Apache License 2.0 | 5 votes |
private ScaleTransition hideWindow() { ScaleTransition st = new ScaleTransition(Duration.millis(100), this); st.setToX(0); st.setToY(0); st.setByX(1); st.setByY(1); st.setCycleCount(1); return st; }
Example 3
Source File: JoustToken.java From metastone with GNU General Public License v2.0 | 5 votes |
public JoustToken(GameBoardView boardView, Card card, boolean up, boolean won) { Window parent = boardView.getScene().getWindow(); this.cardToken = new CardTooltip(); popup = new Popup(); popup.getContent().setAll(cardToken); popup.setX(parent.getX() + 600); popup.show(parent); int offsetY = up ? -200 : 100; popup.setY(parent.getY() + parent.getHeight() * 0.5 - cardToken.getHeight() * 0.5 + offsetY); cardToken.setCard(card); NotificationProxy.sendNotification(GameNotification.ANIMATION_STARTED); FadeTransition animation = new FadeTransition(Duration.seconds(1.0), cardToken); animation.setDelay(Duration.seconds(1f)); animation.setOnFinished(this::onComplete); animation.setFromValue(1); animation.setToValue(0); animation.play(); if (won) { ScaleTransition scaleAnimation = new ScaleTransition(Duration.seconds(0.5f), cardToken); scaleAnimation.setByX(0.1); scaleAnimation.setByY(0.1); scaleAnimation.setCycleCount(2); scaleAnimation.setAutoReverse(true); scaleAnimation.play(); } }