|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.GameContainer org.newdawn.slick.AppletGameContainer.Container
public class AppletGameContainer.Container
A game container to provide the applet context
Field Summary |
---|
Fields inherited from class org.newdawn.slick.GameContainer |
---|
alwaysRender, clearEachFrame, forceExit, fps, game, GL, height, input, lastFPS, lastFrame, lastGame, maximumLogicInterval, minimumLogicInterval, paused, recordedFPS, running, samples, SHARED_DRAWABLE, smoothDeltas, stencil, storedDelta, supportsMultiSample, targetFPS, vsync, width |
Constructor Summary | |
---|---|
AppletGameContainer.Container(Game game)
Create a new container wrapped round the game |
Method Summary | |
---|---|
java.applet.Applet |
getApplet()
Returns the Applet Object |
int |
getScreenHeight()
Get the height of the standard screen resolution |
int |
getScreenWidth()
Get the width of the standard screen resolution |
boolean |
hasFocus()
Check if the game currently has focus |
void |
initApplet()
Initiliase based on Applet init |
boolean |
isFullscreen()
Check if the display is in fullscreen mode |
boolean |
isMouseGrabbed()
Check if the mouse cursor is current grabbed. |
boolean |
isRunning()
Check if the applet is currently running |
void |
runloop()
The running game loop |
void |
setDefaultMouseCursor()
Set the default mouse cursor - i.e. |
void |
setFullscreen(boolean fullscreen)
Indicate whether we want to be in fullscreen mode. |
void |
setIcon(java.lang.String ref)
Set the icon to be displayed if possible in this type of container |
void |
setIcons(java.lang.String[] refs)
Set the icons to be used for this application. |
void |
setMouseCursor(org.lwjgl.input.Cursor cursor,
int hotSpotX,
int hotSpotY)
Set the mouse cursor to be displayed - this is a hardware cursor and hence shouldn't have any impact on FPS. |
void |
setMouseCursor(ImageData data,
int hotSpotX,
int hotSpotY)
Set the mouse cursor to be displayed - this is a hardware cursor and hence shouldn't have any impact on FPS. |
void |
setMouseCursor(Image image,
int hotSpotX,
int hotSpotY)
Set the mouse cursor based on the contents of the image. |
void |
setMouseCursor(java.lang.String ref,
int hotSpotX,
int hotSpotY)
Set the mouse cursor to be displayed - this is a hardware cursor and hence shouldn't have any impact on FPS. |
void |
setMouseGrabbed(boolean grabbed)
Indicate whether mouse cursor should be grabbed or not |
void |
stopApplet()
Stop the applet play back |
boolean |
supportsAlphaInBackBuffer()
Check if the display created supported alpha in the back buffer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AppletGameContainer.Container(Game game)
game
- The game to be held in this containerMethod Detail |
---|
public void initApplet() throws SlickException
SlickException
- Indicates a failure to inialise the basic frameworkpublic boolean isRunning()
public void stopApplet()
public int getScreenHeight()
GameContainer
getScreenHeight
in interface GUIContext
getScreenHeight
in class GameContainer
GameContainer.getScreenHeight()
public int getScreenWidth()
GameContainer
getScreenWidth
in interface GUIContext
getScreenWidth
in class GameContainer
GameContainer.getScreenWidth()
public boolean supportsAlphaInBackBuffer()
public boolean hasFocus()
GameContainer
hasFocus
in class GameContainer
GameContainer.hasFocus()
public java.applet.Applet getApplet()
public void setIcon(java.lang.String ref) throws SlickException
GameContainer
setIcon
in class GameContainer
ref
- The reference to the icon to be displayed
SlickException
- Indicates a failure to load the iconGameContainer.setIcon(java.lang.String)
public void setMouseGrabbed(boolean grabbed)
GameContainer
setMouseGrabbed
in class GameContainer
grabbed
- True if mouse cursor should be grabbedGameContainer.setMouseGrabbed(boolean)
public boolean isMouseGrabbed()
GameContainer
isMouseGrabbed
in class GameContainer
GameContainer.isMouseGrabbed()
public void setMouseCursor(java.lang.String ref, int hotSpotX, int hotSpotY) throws SlickException
GameContainer
setMouseCursor
in interface GUIContext
setMouseCursor
in class GameContainer
ref
- The location of the image to be loaded for the cursorhotSpotX
- The x coordinate of the hotspot within the cursor imagehotSpotY
- The y coordinate of the hotspot within the cursor image
SlickException
- Indicates a failure to load the cursor image or create the hardware cursorGameContainer.setMouseCursor(java.lang.String,
int, int)
public void setMouseCursor(Image image, int hotSpotX, int hotSpotY) throws SlickException
setMouseCursor
in class GameContainer
image
- The image to use as the cursorhotSpotX
- The x coordinate of the hotspot within the cursor imagehotSpotY
- The y coordinate of the hotspot within the cursor image
SlickException
- Indicates a failure to load the cursor image or create the hardware cursorpublic void setIcons(java.lang.String[] refs) throws SlickException
GameContainer
setIcons
in class GameContainer
refs
- The reference to the icon to be displayed
SlickException
- Indicates a failure to load the iconGameContainer.setIcons(java.lang.String[])
public void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException
GameContainer
setMouseCursor
in interface GUIContext
setMouseCursor
in class GameContainer
data
- The image data from which the cursor can be construtedhotSpotX
- The x coordinate of the hotspot within the cursor imagehotSpotY
- The y coordinate of the hotspot within the cursor image
SlickException
- Indicates a failure to load the cursor image or create the hardware cursorGameContainer.setMouseCursor(org.newdawn.slick.opengl.ImageData, int, int)
public void setMouseCursor(org.lwjgl.input.Cursor cursor, int hotSpotX, int hotSpotY) throws SlickException
GameContainer
setMouseCursor
in interface GUIContext
setMouseCursor
in class GameContainer
cursor
- The cursor to usehotSpotX
- The x coordinate of the hotspot within the cursor imagehotSpotY
- The y coordinate of the hotspot within the cursor image
SlickException
- Indicates a failure to load the cursor image or create the hardware cursorGameContainer.setMouseCursor(org.lwjgl.input.Cursor, int, int)
public void setDefaultMouseCursor()
GameContainer
setDefaultMouseCursor
in interface GUIContext
setDefaultMouseCursor
in class GameContainer
GameContainer.setDefaultMouseCursor()
public boolean isFullscreen()
GameContainer
isFullscreen
in class GameContainer
public void setFullscreen(boolean fullscreen) throws SlickException
GameContainer
setFullscreen
in class GameContainer
fullscreen
- True if we want to be in fullscreen mode
SlickException
- Indicates we failed to change the display modepublic void runloop() throws java.lang.Exception
java.lang.Exception
- Indicates a failure within the game's loop rather than the framework
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |