|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSprite
vooga.engine.overlay.Overlay
vooga.engine.overlay.OverlayString
vooga.widget.clock.OverlayClock
public class OverlayClock
OverlayClock displays a string representing the current
local time on the screen. It is an extension of OverlayString
where the String to be displayed is always the local time. The
time is determined on update which means that the clock can be
paused. If this behavior is not desired, do not place the
OverlayClock in a GameState which renders without updating. The
font and color of the clock are customizable. If the clock is
specifying the incorrect time, make sure that you set the proper
time zone for WorldClock. The default way to display time is
the 24 time format.
Sample initialization using default 24 hour time:
Field Summary |
---|
Fields inherited from class vooga.engine.overlay.OverlayString |
---|
DEFAULT_COLOR, DEFAULT_FONT |
Constructor Summary | |
---|---|
OverlayClock()
Create a clock with default font and color |
|
OverlayClock(java.awt.Color color)
Create a clock with default font and custom color |
|
OverlayClock(java.awt.Font font)
Create a clock with default color and custom font |
|
OverlayClock(java.util.Map<java.lang.String,java.lang.String> attributes,
OverlayTracker tracker)
|
|
OverlayClock(TimeReader timeReader)
Create a clock with default font and color and a custom TimeReader |
|
OverlayClock(TimeReader timeReader,
java.awt.Font font,
java.awt.Color color)
Create a clock with custom font and color |
Method Summary | |
---|---|
void |
update(long elapsedTime)
Updates the string to be displayed to be the current time designated by WorldClock. |
Methods inherited from class vooga.engine.overlay.OverlayString |
---|
getHeight, getString, getWidth, print, render, setColor, setFont, setFont, setString |
Methods inherited from class vooga.engine.overlay.Overlay |
---|
setLocation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OverlayClock()
public OverlayClock(TimeReader timeReader)
public OverlayClock(java.awt.Font font)
font
- Font used to render the clock digitspublic OverlayClock(java.awt.Color color)
color
- Color used to render the clockpublic OverlayClock(TimeReader timeReader, java.awt.Font font, java.awt.Color color)
font
- Font used to render clock digitscolor
- Color used to render clockpublic OverlayClock(java.util.Map<java.lang.String,java.lang.String> attributes, OverlayTracker tracker)
Method Detail |
---|
public void update(long elapsedTime)
elapsedTime
- not used
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |