Class SkilltreeDisplay
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.components.skilltree.SkilltreeDisplay
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
SkilltreeDisplay is a UI component responsible for rendering the skill tree interface. It
provides a background, displays a dialog when attempting to unlock a skill, and handles
unlock/close actions with appropriate sounds and UI updates.
-
Field Summary
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage
Fields inherited from class com.csse3200.game.rendering.RenderComponent
colour
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the component is created.protected void
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw method for custom rendering.void
unlockedPopUp
(Skill skill, SkillSet skillSet, com.badlogic.gdx.graphics.Texture unlockedTexture, com.badlogic.gdx.scenes.scene2d.ui.Button skillButton, com.badlogic.gdx.scenes.scene2d.Stage stage) Displays a popup dialog for unlocking a skill.Methods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndex
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, dispose, getColour, render, setColour
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPriority, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
SkilltreeDisplay
public SkilltreeDisplay()Creates a new SkilltreeDisplay.
-
-
Method Details
-
create
public void create()Called when the component is created. Adds initial actors to the stage.- Overrides:
create
in classUIComponent
-
draw
protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw method for custom rendering. Currently unused since this class relies on Scene2D UI elements.- Specified by:
draw
in classRenderComponent
- Parameters:
batch
- the SpriteBatch used for rendering
-
unlockedPopUp
public void unlockedPopUp(Skill skill, SkillSet skillSet, com.badlogic.gdx.graphics.Texture unlockedTexture, com.badlogic.gdx.scenes.scene2d.ui.Button skillButton, com.badlogic.gdx.scenes.scene2d.Stage stage) Displays a popup dialog for unlocking a skill. The dialog shows skill details, and provides options to unlock the skill (if possible) or close the dialog.- Parameters:
skill
- the skill being displayedskillSet
- the player's current skill setunlockedTexture
- texture to display when a skill is unlockedskillButton
- the button representing the skill in the treestage
- the stage to which the popup will be added
-