Class SkilltreeActions

java.lang.Object
com.badlogic.gdx.scenes.scene2d.InputListener
com.badlogic.gdx.scenes.scene2d.utils.ClickListener
com.csse3200.game.components.skilltree.SkilltreeActions
All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.EventListener

public class SkilltreeActions extends com.badlogic.gdx.scenes.scene2d.utils.ClickListener
SkilltreeActions is a click listener for skill tree buttons. It handles user interactions with individual skill buttons:
  • Field Summary

    Fields inherited from class com.badlogic.gdx.scenes.scene2d.utils.ClickListener

    visualPressedDuration
  • Constructor Summary

    Constructors
    Constructor
    Description
    SkilltreeActions(String skillName, SkillSet skillSet, com.badlogic.gdx.graphics.Texture unlockedTexture, com.badlogic.gdx.scenes.scene2d.ui.Button skillButton, com.badlogic.gdx.scenes.scene2d.Stage stage, SkilltreeDisplay display)
    Creates a new SkilltreeActions listener.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    clicked(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y)
    Called when the skill button is clicked.
    void
    enter(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, com.badlogic.gdx.scenes.scene2d.Actor fromActor)
    Called when the cursor enters the skill button area.
    void
    exit(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, com.badlogic.gdx.scenes.scene2d.Actor toActor)
    Called when the cursor exits the skill button area.

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.utils.ClickListener

    cancel, getButton, getPressedButton, getPressedPointer, getTapCount, getTapSquareSize, getTouchDownX, getTouchDownY, inTapSquare, inTapSquare, invalidateTapSquare, isOver, isOver, isPressed, isVisualPressed, setButton, setTapCount, setTapCountInterval, setTapSquareSize, setVisualPressed, touchDown, touchDragged, touchUp

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.InputListener

    handle, keyDown, keyTyped, keyUp, mouseMoved, scrolled

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SkilltreeActions

      public SkilltreeActions(String skillName, SkillSet skillSet, com.badlogic.gdx.graphics.Texture unlockedTexture, com.badlogic.gdx.scenes.scene2d.ui.Button skillButton, com.badlogic.gdx.scenes.scene2d.Stage stage, SkilltreeDisplay display)
      Creates a new SkilltreeActions listener.
      Parameters:
      skillName - the name of the skill this button represents
      skillSet - the player's current skill set
      unlockedTexture - texture to display once the skill is unlocked
      skillButton - the button representing the skill
      stage - the stage to which UI components are added
      display - the skill tree display that manages popups
  • Method Details

    • clicked

      public void clicked(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y)
      Called when the skill button is clicked. Plays a click sound and displays the unlock popup for the associated skill.
      Overrides:
      clicked in class com.badlogic.gdx.scenes.scene2d.utils.ClickListener
      Parameters:
      event - the input event
      x - the x-coordinate of the click
      y - the y-coordinate of the click
    • enter

      public void enter(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, com.badlogic.gdx.scenes.scene2d.Actor fromActor)
      Called when the cursor enters the skill button area. Plays a hover sound and scales the button up slightly for visual feedback.
      Overrides:
      enter in class com.badlogic.gdx.scenes.scene2d.utils.ClickListener
      Parameters:
      event - the input event
      x - x-coordinate of the cursor
      y - y-coordinate of the cursor
      pointer - pointer index
      fromActor - the actor the cursor came from
    • exit

      public void exit(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, com.badlogic.gdx.scenes.scene2d.Actor toActor)
      Called when the cursor exits the skill button area. Scales the button back to its original size.
      Overrides:
      exit in class com.badlogic.gdx.scenes.scene2d.utils.ClickListener
      Parameters:
      event - the input event
      x - x-coordinate of the cursor
      y - y-coordinate of the cursor
      pointer - pointer index
      toActor - the actor the cursor moves to