Class NonDraggableCharacter

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, Renderable, Comparable<Renderable>

public class NonDraggableCharacter extends UIComponent
  • Constructor Details

    • NonDraggableCharacter

      public NonDraggableCharacter()
  • Method Details

    • create

      public void create()
      Initializes the character by adding the image actor to the stage.
      Overrides:
      create in class UIComponent
    • dispose

      public void dispose()
      Disposes of the character image.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent
    • draw

      protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Draws the character image at the specified offsets.
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - The SpriteBatch used for drawing.
    • getTexturePath

      public String getTexturePath()
      Gets the current texture path of the character.
      Returns:
      The texture path as a String.
    • getOffsetX

      public float getOffsetX()
      Gets the current X offset of the character image.
      Returns:
      The X offset as a float.
    • getOffsetY

      public float getOffsetY()
      Gets the current Y offset of the character image.
      Returns:
      The Y offset as a float.
    • getScale

      public float getScale()
      Gets the current scale of the character image.
      Returns:
      The scale as a float.
    • update

      public void update()
      A function that checks if the 'R' key is pressed while the mouse is over the character image. If so, it removes the image from the stage and disposes of the entity.
      Overrides:
      update in class Component
    • setTexture

      public void setTexture(String path)
    • setOffsets

      public void setOffsets(float x, float y)
    • setScale

      public void setScale(float scale)