A C D E F G H I J K L M O P R S T X Y

A

addGameState(String) - Method in class jgame.JGEngine
Add the given state to the game's existing state.
alarm() - Method in class jgame.JGTimer
define your alarm action here.
and(int, int) - Method in class jgame.JGEngine
A Boolean AND shorthand to use for collision; returns (value&mask) != 0.

C

checkBGCollision(Rectangle) - Method in class jgame.JGEngine
Check collision of tiles within given rectangle, return the OR of all cids found.
checkBGCollision(int, int) - Method in class jgame.JGEngine
Calls all bg colliders of objects that match objid that collide with tiles that match tileid.
checkCollision(int, int) - Method in class jgame.JGEngine
Calls all colliders of objects that match dstid that collide with objects that match srcid.
clearAnim() - Method in class jgame.JGObject
Clear the animation, the object's current image will remain.
clearBBox() - Method in class jgame.JGObject
Clear bbox definition so that we use the image bbox again.
clearBG(String) - Method in class jgame.JGEngine
Fill the background with the given tile.
clearGameState() - Method in class jgame.JGEngine
Set the game's main state to none.
clearKey(int) - Method in class jgame.JGEngine
Set the key status of a key to released.
clearTileBBox() - Method in class jgame.JGObject
Clear tile bbox definition so that we use the regular bbox again.
colid - Variable in class jgame.JGObject
Collision ID
countObjects(String, int) - Method in class jgame.JGEngine
Count how many objects there are with both the given name prefix and have colid&cidmask != 0.
crop(Image, int, int, int, int) - Method in class jgame.ImageUtil
 

D

defineAnimation(String, String[], double) - Method in class jgame.JGEngine
 
defineAnimation(String, String[], double, int) - Method in class jgame.JGEngine
 
defineAnimation(String, String[], double, int, boolean) - Method in class jgame.JGEngine
 
defineImage(String, String, int, String, boolean, String, int, int, int, int) - Method in class jgame.JGEngine
Define new sprite/tile image.
defineImage(String, String, int, String, int, boolean, String, int, int, int, int) - Method in class jgame.JGEngine
Define new image from map.
defineImageMap(String, String, int, int, int, int, int, int) - Method in class jgame.JGEngine
Define image map, a large image containing a number of smaller images to use for sprites or fonts.
defineImages(String) - Method in class jgame.JGEngine
Load a set of imagemap, image, and animation definitions from a file.
destroy() - Method in class jgame.JGEngine
Destroy function for deinitialising the engine properly.
doFrame() - Method in class jgame.JGEngine
Is called every frame.
drawImage(int, int, String) - Method in class jgame.JGEngine
Draw image with given ID
drawImageString(String, int, int, String, int, int) - Method in class jgame.JGEngine
Draws a single line of text using an image map as font; text alignment is always top left.
drawString(String, int, int, int) - Method in class jgame.JGEngine
draws string so that (x,y) is the topleft coordinate (align=-1), the top middle coordinate (align=0), or the top right coordinate (align=1).

E

eng - Variable in class jgame.JGObject
You can use this to call methods in the object's engine.
ensureLoaded(Image) - Method in class jgame.ImageUtil
 
existsObject(String) - Method in class jgame.JGEngine
Get object if it exists, null if not.
expiry - Variable in class jgame.JGObject
Set number of move() steps before object removes itself, -1 (default) is never; -2 means expire when off-screen.

F

flip(Image, boolean, boolean) - Method in class jgame.ImageUtil
 

G

getAnimId() - Method in class jgame.JGObject
 
getBBox() - Method in class jgame.JGObject
Get collision bounding box in pixels.
getBGTileCid(int, int) - Method in class jgame.JGEngine
Get cid of tile at given tile index position.
getBGTileCid(Point, int, int) - Method in class jgame.JGEngine
Get the tile cid of the point that is (xofs,yofs) from the tile index coordinate center.
getBGTileCid(Rectangle) - Method in class jgame.JGEngine
Get the OR of the cids at the tile indexes given by tiler
getBGTileCidAtCoord(double, double) - Method in class jgame.JGEngine
Get collision Id of the tile at given pixel coordinates.
getBGTileString(int, int) - Method in class jgame.JGEngine
get string id of tile at given index position
getBGTileString(Point, int, int) - Method in class jgame.JGEngine
Get the tile string of the point that is (xofs,yofs) from the tile index coordinate center.
getBGTileStringAtCoord(double, double) - Method in class jgame.JGEngine
Get collision Id of the tile at given pixel coordinates.
getBufferGraphics() - Method in class jgame.JGEngine
Get the graphics context for drawing on the buffer during a paintFrame().
getCenterTileTopLeft() - Method in class jgame.JGObject
Get the top left coordinate of the center tiles of the object, i.e.
getCenterTiles() - Method in class jgame.JGObject
Get the tile indices spanning the tiles that the object has the most overlap with.
getFullPath(String) - Method in class jgame.JGEngine
Add base URL of the current environment to the given file path; this will result in a URL that both applications and applets can load from.
getImage(String) - Method in class jgame.JGObject
Get object's current image ID
getImageBBox(String) - Method in class jgame.JGEngine
Gets the collision bounding box of an image.
getImageBBox() - Method in class jgame.JGObject
Get collision bounding box of object's image (same as object's, only with offset (0,0)).
getKey(int) - Method in class jgame.JGEngine
Get the key status of the given key.
getLastBBox() - Method in class jgame.JGObject
Get collision bounding box in pixels of previous frame.
getLastCenterTiles() - Method in class jgame.JGObject
 
getLastTileBBox() - Method in class jgame.JGObject
Get tile collision bounding box of previous frame.
getLastTileSpan() - Method in class jgame.JGObject
Get the tile index coordinates of the object's previous tile bbox.
getLastX() - Method in class jgame.JGObject
Get x position of previous frame.
getLastY() - Method in class jgame.JGObject
Get y position of previous frame.
getMinScaleFactor() - Method in class jgame.JGEngine
Get minimum of the x and y scale factors
getName() - Method in class jgame.JGObject
Get object's ID
getObject(String) - Method in class jgame.JGEngine
Get object if it exists, null if not.
getPixels(Image) - Method in class jgame.ImageUtil
 
getPixels(Image, int, int, int, int) - Method in class jgame.ImageUtil
 
getSize(Image) - Method in class jgame.ImageUtil
 
getTileBBox() - Method in class jgame.JGObject
Get collision bounding box in pixels for the purpose of colliding with tiles.
getTileIndex(double, double) - Method in class jgame.JGEngine
Get tile index of the tile the coordinate is on.
getTileSpan(Rectangle) - Method in class jgame.JGEngine
Get tile index range of all tiles overlapping given rectangle of pixel coordinates.
getTileSpan() - Method in class jgame.JGObject
Get the tile index coordinates of the object's tile bbox.
getTopLeftTile() - Method in class jgame.JGObject
Get the top left tile of the object's tile bbox.
getXScaleFactor() - Method in class jgame.JGEngine
Get scale factor of real screen width wrt virtual screen width
getYScaleFactor() - Method in class jgame.JGEngine
Get scale factor of real screen height wrt virtual screen height

H

hit(JGObject) - Method in class jgame.JGObject
Override to handle collision; default is do nothing.
hit_bg(int) - Method in class jgame.JGObject
Override to handle tile collision; default is do nothing.
hit_bg(int, int, int, int, int) - Method in class jgame.JGObject
Override to handle tile collision; default is do nothing.

I

ImageUtil - class jgame.ImageUtil.
Some handy utilities for loading an manipulating images; used internally by jgame.
ImageUtil(Component) - Constructor for class jgame.ImageUtil
 
inGameState(String) - Method in class jgame.JGEngine
Check if game is in given state.
init() - Method in class jgame.JGEngine
Initialise engine; don't call directly.
initEngine(int, int, int, int, Color, Color, Font, int, int) - Method in class jgame.JGEngine
Init engine as application.
initEngineApplet(int, int, int, int, Color, Color, Font) - Method in class jgame.JGEngine
Init engine as applet; call this in your engine constructor.
initGame() - Method in class jgame.JGEngine
Override to define your own initialisations.
isAlive() - Method in class jgame.JGObject
Check if object is still active, or has already been removed.
isBottomAligned(double) - Method in class jgame.JGObject
Returns true if the bottom of the object's tile bbox is within margin of being tile grid aligned.
isLeftAligned(double) - Method in class jgame.JGObject
Returns true if the left of the object's tile bbox is within margin of being tile grid aligned.
isOnScreen(int, int) - Method in class jgame.JGObject
Margin is the margin beyond which the object is considered offscreen.
isRightAligned(double) - Method in class jgame.JGObject
Returns true if the right of the object's tile bbox is within margin of being tile grid aligned.
isTopAligned(double) - Method in class jgame.JGObject
Returns true if the top of the object's tile bbox is within margin of being tile grid aligned.
isXAligned(double, double) - Method in class jgame.JGEngine
Returns true if x falls within margin of the tile snap grid.
isXAligned() - Method in class jgame.JGObject
Returns true if x is distance xspeed/2 away from being grid aligned.
isXAligned(double) - Method in class jgame.JGObject
Returns true if x is within margin of being tile grid aligned.
isYAligned(double, double) - Method in class jgame.JGEngine
Returns true if y falls within margin of the tile snap grid.
isYAligned() - Method in class jgame.JGObject
Returns true if y is distance yspeed/2 away from being grid aligned.
isYAligned(double) - Method in class jgame.JGObject
Returns true if y is within margin of being tile grid aligned.

J

JGEngine - class jgame.JGEngine.
Contains the main functionality of the game engine.
JGEngine() - Constructor for class jgame.JGEngine
Construct engine, but do not initialise it yet.
JGObject - class jgame.JGObject.
Superclass for game objects, override to define animated game objects.
JGObject(String, boolean, double, double, int, String) - Constructor for class jgame.JGObject
Create object.
JGObject(String, boolean, double, double, int, String, int, int, int, int) - Constructor for class jgame.JGObject
Create object with given tile bbox.
JGObject(String, boolean, double, double, int, String, double, double) - Constructor for class jgame.JGObject
Create object with given absolute speed.
JGObject(String, boolean, double, double, int, String, int, int, int, int, double, double) - Constructor for class jgame.JGObject
Create object with given tile bbox and absolute speed.
JGObject(String, boolean, double, double, int, String, double, double, int) - Constructor for class jgame.JGObject
Create object with given absolute speed, expiry.
JGObject(String, boolean, double, double, int, String, int, int, int, int, double, double, int) - Constructor for class jgame.JGObject
Create object with given tile bbox, absolute speed, expiry.
JGObject(String, boolean, double, double, int, String, int, int, double, double, int) - Constructor for class jgame.JGObject
Create object with given direction/speed, expiry.
JGObject(String, boolean, double, double, int, String, int, int, int, int, int, int, double, double, int) - Constructor for class jgame.JGObject
Create object with given tile bbox, direction/speed, expiry.
JGTimer - class jgame.JGTimer.
A timer that generates a callback after a certain number of frames.
JGTimer(int, boolean) - Constructor for class jgame.JGTimer
Create timer; the timer may be one-shot (it runs only once, then triggers the alarm and removes itself), or continuous (it continues running and triggering the alarm)
jgame - package jgame
Contains the essential classes of JGame, a 2D game engine.

K

KeyAlt - Static variable in class jgame.JGEngine
 
KeyCtrl - Static variable in class jgame.JGEngine
 
KeyDown - Static variable in class jgame.JGEngine
 
KeyLeft - Static variable in class jgame.JGEngine
 
KeyRight - Static variable in class jgame.JGEngine
 
KeyShift - Static variable in class jgame.JGEngine
 
KeyUp - Static variable in class jgame.JGEngine
 

L

loadImage(String) - Method in class jgame.ImageUtil
Returns null if there was an error.
loadImage(URL) - Method in class jgame.ImageUtil
Returns null if there was an error.

M

mediatracker - Variable in class jgame.ImageUtil
 
move() - Method in class jgame.JGObject
Override to implement automatic move; default is do nothing.
moveObjects(String, int) - Method in class jgame.JGEngine
Call the move() methods of those objects matching the given name prefix and collision id mask.
moveObjects() - Method in class jgame.JGEngine
Call all move() methods of all registered objects.

O

observer - Variable in class jgame.ImageUtil
 
one_shot - Variable in class jgame.JGTimer
 

P

paintFrame() - Method in class jgame.JGEngine
Is called when the engine's default screen painting is finished, and custom painting actions may be carried out.
pfHeight() - Method in class jgame.JGEngine
Get the virtual height in pixels (not the scaled screen height)
pfTileHeight() - Method in class jgame.JGEngine
Get the tile height in (virtual) pixels.
pfTileWidth() - Method in class jgame.JGEngine
Get the tile width in (virtual) pixels.
pfTilesX() - Method in class jgame.JGEngine
Get the number of tiles in X direction
pfTilesY() - Method in class jgame.JGEngine
Get the number of tiles in Y direction
pfWidth() - Method in class jgame.JGEngine
Get the virtual width in pixels (not the scaled screen width)

R

random(double, double) - Method in class jgame.JGEngine
 
random(double, double, double) - Method in class jgame.JGEngine
 
remove() - Method in class jgame.JGObject
Mark object for removal.
removeObjects(String, int) - Method in class jgame.JGEngine
Remove all objects which have the given name prefix and/or match the given cidmask.
resetAnim(String) - Method in class jgame.JGObject
Always set the animation to the given default animation definition, resetting any changes or updates made to the animation.
resetAnim() - Method in class jgame.JGObject
Reset the animation's state to the start state.
rotate(Image, int) - Method in class jgame.ImageUtil
for angle, only increments of 90 are allowed
running - Variable in class jgame.JGTimer
 

S

scale(Image, int, int) - Method in class jgame.ImageUtil
 
set(int, boolean) - Method in class jgame.JGTimer
 
setAnim(String) - Method in class jgame.JGObject
Set the animation to the given default animation definition, or leave it as it was if the anim_id is unchanged.
setAnimIncrement(int) - Method in class jgame.JGObject
 
setAnimPingpong(boolean) - Method in class jgame.JGObject
 
setAnimSpeed(double) - Method in class jgame.JGObject
 
setBBox(int, int, int, int) - Method in class jgame.JGObject
Set bbox definition to override the image bbox.
setBGColor(Color) - Method in class jgame.JGEngine
Set global background colour.
setBGImage(String) - Method in class jgame.JGEngine
Set image to display behind transparent tiles.
setBGTile(int, int, String) - Method in class jgame.JGEngine
Define a single tile.
setBGTiles(int, int, String[]) - Method in class jgame.JGEngine
Set a block of tiles according to the chars in the nxm char array tilemap.
setBGTilesMulti(int, int, String[]) - Method in class jgame.JGEngine
Set a block of tiles according to the tile names in the nxm element array tilemap.
setBoundingBoxDebug(boolean) - Static method in class jgame.JGEngine
 
setColor(Color) - Method in class jgame.JGEngine
Set global foreground colour, used for printing text and status messages.
setColorsFont(Color, Color, Font) - Method in class jgame.JGEngine
Set foreground and background colour and font in one go; passing null means ignore.
setDir(int, int) - Method in class jgame.JGObject
Set direction.
setDirSpeed(int, int, double, double) - Method in class jgame.JGObject
Set speed and direction in one go.
setDirSpeed(int, int, double) - Method in class jgame.JGObject
Set speed and direction in one go.
setFont(Font) - Method in class jgame.JGEngine
Set font for printing text and status messages.
setFrameRate(double, double) - Method in class jgame.JGEngine
Set frame rate in frames per second, and maximum number of frames that may be skipped before displaying a frame again.
setGameState(String) - Method in class jgame.JGEngine
Set the game's main state.
setGraphic(String) - Method in class jgame.JGObject
Set ID of animation or image to display.
setImage(String) - Method in class jgame.JGObject
Set ID of image to display; stop animation if one was running
setKey(int) - Method in class jgame.JGEngine
Set the key status of a key to pressed.
setPos(double, double) - Method in class jgame.JGObject
 
setSpeed(double, double) - Method in class jgame.JGObject
Set relative speed; the values are copied into xspeed,yspeed.
setSpeed(double) - Method in class jgame.JGObject
Set relative speed; the value is copied into xspeed,yspeed.
setSpeedAbs(double, double) - Method in class jgame.JGObject
Set absolute speed.
setTileBBox(int, int, int, int) - Method in class jgame.JGObject
 
snapBBoxToGrid(double, double, boolean, boolean) - Method in class jgame.JGObject
Snap an object's tile bbox corner to grid; floats are rounded down.
snapToGrid(Point, int, int) - Method in class jgame.JGEngine
Snap p to grid in case p is close enough to the grid lines.
snapToGrid() - Method in class jgame.JGObject
Snap object to grid using the default gridsnap margin of (xspeed/2, yspeed/2), corresponding to the default is...Aligned margin.
snapToGrid(double, double) - Method in class jgame.JGObject
Snap object to grid.
snapToGridX(double, double) - Method in class jgame.JGEngine
Snap to grid, double version.
snapToGridY(double, double) - Method in class jgame.JGEngine
Snap to grid, double version.
start() - Method in class jgame.JGEngine
Signal that the engine should start running
startAnim() - Method in class jgame.JGObject
 
stop() - Method in class jgame.JGEngine
signal that the engine should stop running and wait
stopAnim() - Method in class jgame.JGObject
 

T

toBuffered(Image) - Method in class jgame.ImageUtil
Create buffered version of image for faster drawing.

X

x - Variable in class jgame.JGObject
Object position
xdir - Variable in class jgame.JGObject
Object direction, is multiplied with speed; default=1
xspeed - Variable in class jgame.JGObject
Object speed; default=0

Y

y - Variable in class jgame.JGObject
Object position
ydir - Variable in class jgame.JGObject
Object direction, is multiplied with speed; default=1
yspeed - Variable in class jgame.JGObject
Object speed; default=0

A C D E F G H I J K L M O P R S T X Y