netsurfers.gicp.net.ui
类 GameView
java.lang.Object
SurfaceView
netsurfers.gicp.net.ui.ArcadeView
netsurfers.gicp.net.ui.GameView
- 所有已实现的接口:
- Runnable
public class GameView
- extends ArcadeView
GameView is the main part to display graphics of the game. Extends ArcadeView
- 作者:
- Ziliang Wang, E-mail: Lional.King@gmail.com
构造方法摘要 |
GameView(Context context)
|
GameView(Context context,
AttributeSet attrs)
|
GameView(Context context,
AttributeSet attrs,
int defStyle)
|
方法摘要 |
void |
drawFrame(Bitmap bitmap,
int column,
int row,
int currentframe,
float x,
float y,
Canvas cv)
|
void |
drawImage(Bitmap bitmap,
float x,
float y,
Canvas cv)
|
void |
drawImage(Bitmap bitmap,
int cur,
int max,
int dis,
Canvas cv)
Draw the HP and MP on left top. |
void |
drawImage(Bitmap bitmap,
Rect src,
RectF dst,
Canvas cv)
|
void |
drawText(String str,
float x,
float y,
Canvas cv)
|
int |
getCurrentFrame()
|
float |
getCurrentX()
|
float |
getCurrentY()
|
Constants.ORIENTATION |
getPlayerState()
|
boolean |
onKeyDown(int keyCode,
KeyEvent event)
|
boolean |
onKeyUp(int keyCode,
KeyEvent event)
|
boolean |
onTouchEvent(MotionEvent event)
|
void |
run()
|
void |
setBitmapMgr(BitmapMgr bm)
|
void |
setCurrentX(float x)
|
void |
setCurrentY(float y)
|
void |
setGameActivity(GameActivity ga)
|
void |
setPlayerState(Constants.ORIENTATION orient)
|
void |
surfaceChanged(SurfaceHolder surfaceholder,
int format,
int width,
int height)
|
void |
surfaceCreated(SurfaceHolder holder)
|
void |
surfaceDestroyed(SurfaceHolder holder)
|
mPlayerState
public Constants.ORIENTATION mPlayerState
GameView
public GameView(Context context)
- 参数:
context
-
GameView
public GameView(Context context,
AttributeSet attrs)
- 参数:
context
- attrs
-
GameView
public GameView(Context context,
AttributeSet attrs,
int defStyle)
- 参数:
context
- attrs
- defStyle
-
surfaceChanged
public void surfaceChanged(SurfaceHolder surfaceholder,
int format,
int width,
int height)
surfaceCreated
public void surfaceCreated(SurfaceHolder holder)
surfaceDestroyed
public void surfaceDestroyed(SurfaceHolder holder)
onKeyDown
public boolean onKeyDown(int keyCode,
KeyEvent event)
onKeyUp
public boolean onKeyUp(int keyCode,
KeyEvent event)
onTouchEvent
public boolean onTouchEvent(MotionEvent event)
run
public void run()
getCurrentFrame
public int getCurrentFrame()
- 返回:
drawFrame
public void drawFrame(Bitmap bitmap,
int column,
int row,
int currentframe,
float x,
float y,
Canvas cv)
- 参数:
bitmap
- column
- row
- currentframe
- x
- y
- cv
-
drawImage
public void drawImage(Bitmap bitmap,
int cur,
int max,
int dis,
Canvas cv)
- Draw the HP and MP on left top.
- 参数:
bitmap
- cur
- max
- dis
- cv
-
drawImage
public void drawImage(Bitmap bitmap,
Rect src,
RectF dst,
Canvas cv)
- 参数:
bitmap
- src
- dst
- cv
-
drawImage
public void drawImage(Bitmap bitmap,
float x,
float y,
Canvas cv)
- 参数:
bitmap
- x
- y
- cv
-
drawText
public void drawText(String str,
float x,
float y,
Canvas cv)
- 参数:
str
- x
- y
- cv
-
setBitmapMgr
public void setBitmapMgr(BitmapMgr bm)
- 参数:
bm
-
getCurrentX
public float getCurrentX()
- 返回:
setCurrentX
public void setCurrentX(float x)
- 参数:
x
-
getCurrentY
public float getCurrentY()
- 返回:
setCurrentY
public void setCurrentY(float y)
- 参数:
y
-
getPlayerState
public Constants.ORIENTATION getPlayerState()
- 返回:
setPlayerState
public void setPlayerState(Constants.ORIENTATION orient)
- 参数:
orient
-
setGameActivity
public void setGameActivity(GameActivity ga)
- 参数:
orient
-