java.lang.Object
fr.r1r0r0.deltaengine.model.sprites.shapes.Shape
fr.r1r0r0.deltaengine.model.sprites.shapes.Rectangle
All Implemented Interfaces:
Sprite

public class Rectangle
extends Shape
Rectangle Sprite
  • Field Summary

    Fields
    Modifier and Type Field Description
    private javafx.scene.shape.Rectangle fxRectangle  
  • Constructor Summary

    Constructors
    Constructor Description
    Rectangle​(double width, double height, Color color)
    Instantiate the Rectangle Sprite
    Rectangle​(Color color)
    Instantiate the Rectangle Sprite
  • Method Summary

    Modifier and Type Method Description
    javafx.scene.shape.Shape getFXShape()
    more often than not, Javafx is used for shapes
    void resize​(double width, double height)
    resize the sprite to the following width and height
    void setColor​(Color color)
    set the color of the Rectangle

    Methods inherited from class fr.r1r0r0.deltaengine.model.sprites.shapes.Shape

    getNode

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface fr.r1r0r0.deltaengine.model.sprites.Sprite

    getLayout, getRotate, getScale, getSize, getZOrder, setLayout, setLayout, setRotate, setScale, setZOrder
  • Field Details

    • fxRectangle

      private final javafx.scene.shape.Rectangle fxRectangle
  • Constructor Details

    • Rectangle

      public Rectangle​(Color color)
      Instantiate the Rectangle Sprite
      Parameters:
      color - of the Rectangle
    • Rectangle

      public Rectangle​(double width, double height, Color color)
      Instantiate the Rectangle Sprite
      Parameters:
      width - of the Rectangle
      height - of the Rectangle
      color - of the Rectangle
  • Method Details

    • setColor

      public void setColor​(Color color)
      set the color of the Rectangle
      Parameters:
      color - the new color of the Rectangle
    • getFXShape

      public javafx.scene.shape.Shape getFXShape()
      Description copied from class: Shape
      more often than not, Javafx is used for shapes
      Specified by:
      getFXShape in class Shape
      Returns:
      the javafx shape used if any
    • resize

      public void resize​(double width, double height)
      Description copied from interface: Sprite
      resize the sprite to the following width and height