Class DialogueBoxDisplay
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.rendering.RenderComponent
com.deco2800.game.ui.UIComponent
com.deco2800.game.components.maingame.DialogueBoxDisplay
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
Represents a Dialogue Box to be displayed randomly
-
Field Summary
Fields inherited from class com.deco2800.game.ui.UIComponent
skin, stage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add all necessary dialogue box componentsvoid
create()
Called when the entity is created and registered.void
dispose()
Called when the component is disposed.void
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Query current sizing of window and UI items and size/position appropriatelyvoid
hide()
Make invisible if not alreadyboolean
isHidden()
Query if the dialogue box is currently invisiblevoid
setDialogue
(String dialogue) Set current dialogue text to be displayedvoid
Set current image to be displayedvoid
setMinimap
(MinimapComponent minimap) Set current minimap for referencevoid
Set current title to be displayedvoid
show()
Make visible if not alreadyMethods inherited from class com.deco2800.game.ui.UIComponent
getLayer, getZIndex
Methods inherited from class com.deco2800.game.rendering.RenderComponent
compareTo, render
Methods inherited from class com.deco2800.game.components.Component
earlyUpdate, getEntity, isAnimationRenderComponent, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.deco2800.game.rendering.Renderable
render
-
Constructor Details
-
DialogueBoxDisplay
public DialogueBoxDisplay()
-
-
Method Details
-
setMinimap
Set current minimap for reference- Parameters:
minimap
- - current minimap
-
create
public void create()Description copied from class:Component
Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.- Overrides:
create
in classUIComponent
-
addActors
public void addActors()Add all necessary dialogue box components -
setDialogue
Set current dialogue text to be displayed- Parameters:
dialogue
- - dialogue text to be displayed
-
setTitle
Set current title to be displayed- Parameters:
title
- - title to be displayed
-
setImage
Set current image to be displayed- Parameters:
imagePath
- - image to be displayed
-
isHidden
public boolean isHidden()Query if the dialogue box is currently invisible- Returns:
- - true if invisible, false if else
-
hide
public void hide()Make invisible if not already -
show
public void show()Make visible if not already -
draw
public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Query current sizing of window and UI items and size/position appropriately- Specified by:
draw
in classRenderComponent
- Parameters:
batch
- Batch to render to.
-
dispose
public void dispose()Description copied from class:Component
Called when the component is disposed. Dispose of any internal resources here.- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classRenderComponent
-