Available Methods
- getParent ( )
- setDisable ( )
- addEventHandler ( )
- setVisible ( )
- setOpacity ( )
- setTranslateY ( )
- setTranslateX ( )
- setScaleX ( )
- getLayoutX ( )
- setScaleY ( )
- localToScene ( )
- setLayoutX ( )
- prefWidth ( )
- getId ( )
- getBoundsInParent ( )
- sceneToLocal ( )
- setOnMouseClicked ( )
- isVisible ( )
- setEffect ( )
- prefHeight ( )
- setOnMouseEntered ( )
- removeEventHandler ( )
- setOnMousePressed ( )
- setLayoutY ( )
- getLayoutY ( )
- addEventFilter ( )
- requestFocus ( )
- pseudoClassStateChanged ( )
- scaleXProperty ( )
- contains ( )
- getScene ( )
- setOnMouseDragged ( )
- setOnMouseExited ( )
- minWidth ( )
- localToScreen ( )
- setManaged ( )
- setStyle ( )
- getTranslateX ( )
- isFocused ( )
- getClass ( )
- scaleYProperty ( )
- opacityProperty ( )
- getUserData ( )
- minHeight ( )
- getPseudoClassStates ( )
- setOnMouseReleased ( )
- isMouseTransparent ( )
- getProperties ( )
- setMouseTransparent ( )
- rotateProperty ( )
- resizeRelocate ( )
Related Classes
- java.io.File
- java.util.Optional
- java.util.logging.Level
- javafx.scene.Scene
- javafx.stage.Stage
- javafx.application.Platform
- javafx.scene.control.Label
- javafx.scene.control.Button
- javafx.collections.ObservableList
- javafx.event.ActionEvent
- javafx.collections.FXCollections
- javafx.scene.image.Image
- javafx.scene.paint.Color
- javafx.fxml.FXMLLoader
- javafx.event.EventHandler
- javafx.fxml.FXML
- javafx.scene.control.TextField
- javafx.scene.Parent
- javafx.scene.layout.VBox
- javafx.scene.layout.StackPane
- javafx.scene.layout.HBox
- javafx.scene.image.ImageView
- javafx.geometry.Insets
- javafx.scene.input.MouseEvent
- javafx.geometry.Pos
Java Code Examples for javafx.scene.Node#getTranslateX()
The following examples show how to use
javafx.scene.Node#getTranslateX() .
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: Main.java From FXTutorials with MIT License | 6 votes |
private void movePlayerX(int value) { boolean movingRight = value > 0; for (int i = 0; i < Math.abs(value); i++) { for (Node platform : platforms) { if (player.getBoundsInParent().intersects(platform.getBoundsInParent())) { if (movingRight) { if (player.getTranslateX() + config.getPlayerSize() == platform.getTranslateX()) { return; } } else { if (player.getTranslateX() == platform.getTranslateX() + config.getBlockSize()) { return; } } } } player.setTranslateX(player.getTranslateX() + (movingRight ? 1 : -1)); } }
Example 2
Source File: Main.java From FXTutorials with MIT License | 6 votes |
private void movePlayerX(int value) { boolean movingRight = value > 0; for (int i = 0; i < Math.abs(value); i++) { for (Node platform : platforms) { if (player.getBoundsInParent().intersects(platform.getBoundsInParent())) { if (movingRight) { if (player.getTranslateX() + 40 == platform.getTranslateX()) { return; } } else { if (player.getTranslateX() == platform.getTranslateX() + 60) { return; } } } } player.setTranslateX(player.getTranslateX() + (movingRight ? 1 : -1)); } }
Example 3
Source File: XYChartUtils.java From chart-fx with Apache License 2.0 | 4 votes |
public static double getLocationX(final Node node) { return node.getLayoutX() + node.getTranslateX(); }