Interface Sprite

All Known Implementing Classes:
Circle, Ellipse, Image, InvisibleSprite, Rectangle, Shape, Text

public interface Sprite
The Sprite is the graphical component of an element, it can be displayed through it's node
  • Method Summary

    Modifier and Type Method Description
    default Coordinates<java.lang.Double> getLayout()
    Return the component's position (relative to its parent)
    javafx.scene.Node getNode()
    Deprecated.
    avoid using this elsewhere than in Engine
    default double getRotate()
    Return the angle of the component
    default Scale getScale()
    Return the scale used for the component
    default Dimension getSize()
    Return the component's size
    default double getZOrder()
    The depth of the component
    void resize​(double width, double height)
    resize the sprite to the following width and height
    default void setLayout​(double x, double y)
    Set the component's position
    default void setLayout​(Coordinates<java.lang.Double> coordinates)  
    default void setRotate​(double angle)
    Set the angle at which the component is rotated
    default void setScale​(double scaleX, double scaleY)
    Set the component's scale
    default void setZOrder​(double z)
    Update the order or depth of the component
  • Method Details

    • getNode

      @Deprecated javafx.scene.Node getNode()
      Deprecated.
      avoid using this elsewhere than in Engine
      The Sprite object
      Returns:
      the Sprite object
    • resize

      void resize​(double width, double height)
      resize the sprite to the following width and height
      Parameters:
      width -
      height -
    • setLayout

      default void setLayout​(double x, double y)
      Set the component's position
      Parameters:
      x - position
      y - position
    • setLayout

      default void setLayout​(Coordinates<java.lang.Double> coordinates)
    • setScale

      default void setScale​(double scaleX, double scaleY)
      Set the component's scale
      Parameters:
      scaleX - x scale
      scaleY - y scale
    • getScale

      default Scale getScale()
      Return the scale used for the component
      Returns:
      the scale of the graphical element
    • getSize

      default Dimension getSize()
      Return the component's size
      Returns:
      size's dimensions
    • getLayout

      default Coordinates<java.lang.Double> getLayout()
      Return the component's position (relative to its parent)
      Returns:
      position's coordinates
    • getRotate

      default double getRotate()
      Return the angle of the component
      Returns:
      angle value of the component
    • setRotate

      default void setRotate​(double angle)
      Set the angle at which the component is rotated
      Parameters:
      angle - component's new rotation angle
    • getZOrder

      default double getZOrder()
      The depth of the component
      Returns:
      the depth of the sprite
    • setZOrder

      default void setZOrder​(double z)
      Update the order or depth of the component
      Parameters:
      z - is the new depth