|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSurfaceView
android.gameengine.icadroids.renderer.GameView
public class GameView
Class that correctly renders the game on the screen.
Game programmers will not be accessing this class directly,
it is a utility class used by the GameEngine.
Note: javadoc comments not finished
Field Summary | |
---|---|
static int |
BACKGROUND_COLOR
The background colour of the map |
static int |
MAP_HEIGHT
The height of the map |
static int |
MAP_WIDTH
The width of the map |
static boolean |
surfaceLoaded
Surfaceloaded will be true when the surface has been loaded |
Constructor Summary | |
---|---|
GameView(GameEngine ge,
java.lang.Thread gameThread)
Constructs a new viewport |
Method Summary | |
---|---|
void |
drawDebugTiles(Canvas canvas,
float left,
float top,
int tileSize)
|
Point |
getViewportLocation()
|
void |
onDraw(Canvas canvas)
This method allows android to draw. |
void |
setBackgroundFit(boolean backgroundFit)
|
void |
setBackgroundImage(java.lang.String backgroundString)
Sets the background image that will be used in the game. |
void |
setGameThread(java.lang.Thread gamethread)
|
void |
setTileBasedMap(boolean tileBasedMap)
Sets the boolean for the tileBasedMap |
void |
setZoomFactor(float zoomFactor)
Sets the zoomfactor for the current viewport. |
void |
surfaceChanged(SurfaceHolder holder,
int format,
int width,
int height)
This method is called immediately after any structural changes (format or size) have been made to the surface. |
void |
surfaceCreated(SurfaceHolder holder)
This method is called immediately after the surface is first created and it starts a new thread. |
void |
surfaceDestroyed(SurfaceHolder holder)
This method is called immediately before a surface is being destroyed, it Ensures that the thread stops when the gameloop is stopped. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean surfaceLoaded
public static int MAP_HEIGHT
public static int MAP_WIDTH
public static int BACKGROUND_COLOR
Constructor Detail |
---|
public GameView(GameEngine ge, java.lang.Thread gameThread)
ge
- The Game Engine that this GameRenderer is part of.gameThread
- The thread that this renderer will use.Method Detail |
---|
public void surfaceDestroyed(SurfaceHolder holder)
public void surfaceCreated(SurfaceHolder holder)
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
public void drawDebugTiles(Canvas canvas, float left, float top, int tileSize)
public void setBackgroundImage(java.lang.String backgroundString)
backgroundString
- The name of the image that will be used as background.public void setZoomFactor(float zoomFactor)
zoomFactor
- The amount of zoomingpublic void setTileBasedMap(boolean tileBasedMap)
tileBasedMap
- True if a tilebased map is used, otherwise falsepublic void setGameThread(java.lang.Thread gamethread)
public void onDraw(Canvas canvas)
canvas
- The canvas used to draw.public Point getViewportLocation()
public void setBackgroundFit(boolean backgroundFit)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |