Module SypherEngine

Class Sprite2D

java.lang.Object
dev.aurumbyte.sypherengine.ecs.Entity
dev.aurumbyte.sypherengine.ecs.Sprite2D
All Implemented Interfaces:
IRenderable

public abstract class Sprite2D extends Entity

The Sprite class, basically a wrapper over entity, which makes stuff easier.

Since:
0.3.0
Author:
AurumByte
  • Field Details

    • image

      javafx.scene.image.Image image
      The sprite image, could be an image tile
    • animator2D

      Animator2D animator2D
      The animator, which contains sprite animations.
  • Constructor Details

    • Sprite2D

      public Sprite2D(javafx.scene.image.Image spriteImage, float xPos, float yPos)

      Create a new Sprite with just one image as a sprite image

      Parameters:
      spriteImage - The sprite image
      xPos - Position of sprite (x coords)
      yPos - Position of sprite (y coords)
    • Sprite2D

      public Sprite2D(Animator2D animator2D, float xPos, float yPos)

      Create a new Sprite with just one image as a sprite image

      Parameters:
      animator2D - The sprite animation engine
      xPos - Position of sprite (x coords)
      yPos - Position of sprite (y coords)
  • Method Details

    • updateSprite

      public abstract void updateSprite(float deltaTime)

      The update loop for a sprite

      Parameters:
      deltaTime - The deltaTime of the engine
    • update

      public void update(float deltaTime)

      The update loop for the entity, the base of the sprite

      Specified by:
      update in interface IRenderable
      Specified by:
      update in class Entity
      Parameters:
      deltaTime - The deltaTime
    • render

      public void render(SypherEngine engine)

      The render loop for the entity, the base of the sprite

      Specified by:
      render in interface IRenderable
      Specified by:
      render in class Entity
      Parameters:
      engine - The engine