Package de.gurkenlabs.litiengine.gui
Class SpeechBubble
java.lang.Object
de.gurkenlabs.litiengine.gui.SpeechBubble
- All Implemented Interfaces:
IRenderable
,IUpdateable
public class SpeechBubble
extends java.lang.Object
implements IUpdateable, IRenderable
Field Summary
Fields Modifier and Type Field Description static SpeechBubbleAppearance
DEFAULT_APPEARANCE
Method Summary
Modifier and Type Method Description void
addListener(SpeechBubbleListener listener)
static SpeechBubble
create(IEntity entity, java.awt.Font font, java.lang.String text)
static SpeechBubble
create(IEntity entity, java.awt.Font font, java.lang.String text, Sound typeSound)
static SpeechBubble
create(IEntity entity, java.lang.String text)
static SpeechBubble
create(IEntity entity, java.lang.String text, SpeechBubbleAppearance appearance, java.awt.Font font)
SpeechBubbleAppearance
getAppearance()
IEntity
getEntity()
java.awt.Font
getFont()
int
getTextDisplayTime()
void
hide()
static boolean
isActive(IEntity entity)
void
render(java.awt.Graphics2D g)
Renders the visual contents of this instance onto the provided graphics context.void
setFont(java.awt.Font font)
void
setTextDisplayTime(int duration)
void
update()
This method is called by the game loop on all objects that are attached to the loop.
Field Details
Method Details
create
public static SpeechBubble create(IEntity entity, java.lang.String text, SpeechBubbleAppearance appearance, java.awt.Font font)create
create
create
public static SpeechBubble create(IEntity entity, java.awt.Font font, java.lang.String text, Sound typeSound)isActive
addListener
getEntity
getAppearance
getFont
public java.awt.Font getFont()render
public void render(java.awt.Graphics2D g)Description copied from interface:IRenderable
Renders the visual contents of this instance onto the provided graphics context.If an
Entity
implements this interface, this method will be called right after the entity was rendered from the environment. Allowing for a custom rendering mechanism.This interface can be implemented in general by anything that should be rendered to the game's screen.
- Specified by:
render
in interfaceIRenderable
- Parameters:
g
- The current graphics object onto which this instance will render its visual contents.- See Also:
RenderEngine.renderEntity(Graphics2D, de.gurkenlabs.litiengine.entities.IEntity)
setFont
public void setFont(java.awt.Font font)getTextDisplayTime
public int getTextDisplayTime()setTextDisplayTime
public void setTextDisplayTime(int duration)update
public void update()Description copied from interface:IUpdateable
This method is called by the game loop on all objects that are attached to the loop. It's called on every tick of the loop and the frequency can be configured using theClientConfiguration
.- Specified by:
update
in interfaceIUpdateable
- See Also:
ClientConfiguration.setMaxFps(int)
hide
public void hide()