vooga.engine.overlay
Class OverlayCreator
java.lang.Object
vooga.engine.overlay.OverlayCreator
public class OverlayCreator
- extends java.lang.Object
This class is used for creating overlays from an xml file instead of in the
code itself.
For an example see OverlayExample.java.
Click here to view xml file example
Here are all the attributes for all of the different overlays/p>
- OverlayGroup
- Stat
- type - must be "Integer" or "String". This will ideally change
soon so it can be of any type.
- value - initial value
- name - key in map
- All Overlays
- xLoc - x location of the overlay
- yLoc - y location of the overlay
- name - key in map
- OverlayString
- label - String to be displayed
- fontName - any String representing a font, for example
"Times New Roman", or "gameFontGreen"
- fontSize - point size of the font, must be an integer
- fontStyle - style of the font, for example "ITALIC"
- color - color of the font, for example "green". It can also be a
octal or hexidecimal representation of the color
- And all attributes in all Overlays
- OverlayStat
- stat - The stat to be displayed. It must be an integer
representing the order in which the stat was made. if it was the
first one made it would be "0".
- All attributes in OverlayString
- OverlayStatImage
- image - String the image is saved as in the Resources API
- width - scale the size of the image to this width
- height - scale the size of the image to this height. In order to
scale thw width and height must be set
- All of the attributes in all Overlays
- OverlayIcon
- stat - The stat to be used to display icons. Must be a Stat of
type Integer. It must be an integer representing the order in which
the stat was made. if it was the first one made it would be "0".
- All attributes in OverlayIcon
- All attributes in OverlayString
- OverlayBar
- stat - The stat to be displayed on bar. Must be a Stat of type
Integer. It must be an integer representing the order in which the
stat was made. if it was the first one made it would be "0".
- max - the max value of the bar. For example if the max is 100 and
the stat is at 50 the bar will be half full
- color - The color of the value of the bar. By default red. Same
format as the color in OverlayString
- backColor - The color of the background of the bar. By default
black. Same format as the color in OverlayString
- length - The length of the bar
- height - The height of the bar
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OverlayCreator
public OverlayCreator()
createOverlays
public static OverlayTracker createOverlays(java.lang.String xmlFileLocation)
- Parameters:
xmlFileLocation
- - the XML File Location. String xmlFileLocation must be path
from the root of the project
- Returns:
- OverlayTracker containing all stats and overlays.
stringToColor
protected static java.awt.Color stringToColor(java.lang.String value)
- Converts a given string into a color.
- Parameters:
value
- the string, either a name or a hex-string.
- Returns:
- the color.
stringToFontStyle
protected static int stringToFontStyle(java.lang.String style)
getGameFont
protected static GameFont getGameFont(java.lang.String str)
setGame
public static void setGame(Game game)