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 TypeMethodDescriptionvoidAdd all necessary dialogue box componentsvoidcreate()Called when the entity is created and registered.voiddispose()Called when the component is disposed.voiddraw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Query current sizing of window and UI items and size/position appropriatelyvoidhide()Make invisible if not alreadybooleanisHidden()Query if the dialogue box is currently invisiblevoidsetDialogue(String dialogue) Set current dialogue text to be displayedvoidSet current image to be displayedvoidsetMinimap(MinimapComponent minimap) Set current minimap for referencevoidSet current title to be displayedvoidshow()Make visible if not alreadyMethods inherited from class com.deco2800.game.ui.UIComponent
getLayer, getZIndexMethods inherited from class com.deco2800.game.rendering.RenderComponent
compareTo, renderMethods inherited from class com.deco2800.game.components.Component
earlyUpdate, getEntity, isAnimationRenderComponent, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods 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:ComponentCalled 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:
createin 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:
drawin classRenderComponent- Parameters:
batch- Batch to render to.
-
dispose
public void dispose()Description copied from class:ComponentCalled when the component is disposed. Dispose of any internal resources here.- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable- Overrides:
disposein classRenderComponent
-