|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlocation.Hotspot
location.InteractiveHotspot
public class InteractiveHotspot
This class represents an interactive hotspot. That is an extension to a normal hotspot. Normal hotspot usually are used together with game objects in order to make them sensitive to mouse movements. Now an interactive hotspot is a hotspot especially designed to exit stand alone at the game location. That means there is no need to connect it to a game object. The user can perform actions on the hotspot directly, for example via beanshell scripts. The following example may explain this a little further. Imagine a lock that can be opened by certain key. Because you don't want to take the overhead of placeing an item that represents the lock in a door, you can easily setup an interactive hotspot at the place of the look to make it sensitive for actions by the player.
Constructor Summary | |
---|---|
InteractiveHotspot(java.lang.String name,
java.lang.String bshName,
double x,
double y,
int width,
int height,
com.golden.gamedev.engine.BaseInput bsInput,
com.golden.gamedev.engine.BaseLoader bsLoader)
Creates a new hotspot with the specified parameters |
Method Summary | |
---|---|
java.lang.String |
getBshName()
Returns the beanshell name for this interactive hotspot |
boolean |
isActive()
Determines whether the interactive hotspot is active. |
void |
render(java.awt.Graphics2D g)
Renders the interactive hotspot name |
void |
setActive()
Sets the interactive hotspot to active state if it was not active before |
void |
setImage(java.awt.image.BufferedImage img)
Sets the assigned image of the interactive hotspot to the specified image |
void |
setImage(java.lang.String imagePath)
Sets the image assigned to the interactive hotspot |
void |
setInactive()
Sets the interactive hotspot to inactive state. |
Methods inherited from class location.Hotspot |
---|
getHeight, getName, getWidth, getX, getY, isMouseOverHotspot, isMouseOverInventHotspot, isPointInHotspot, isPointInInventHotspot, setHeight, setName, setWidth, setX, setY, showName, update |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InteractiveHotspot(java.lang.String name, java.lang.String bshName, double x, double y, int width, int height, com.golden.gamedev.engine.BaseInput bsInput, com.golden.gamedev.engine.BaseLoader bsLoader)
name
- name that is to be shown on the screen for the
interactive hotspotx
- x-coordinatey
- y-coordinatewidth
- width of the interactive hotspotheight
- height of the interactive hotspotbsInput
- bsLoader
- Method Detail |
---|
public java.lang.String getBshName()
public boolean isActive()
public void setInactive()
public void setActive()
public void setImage(java.awt.image.BufferedImage img)
img
- image to assign to the interactive hotspotpublic void setImage(java.lang.String imagePath)
imagePath
- path+filename of the image to setpublic void render(java.awt.Graphics2D g)
render
in class Hotspot
g
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |