Changeset 3a0d468 in galcon-client for src/com/example/helloandroid/GameView.java
- Timestamp:
- Jun 20, 2010, 6:29:03 PM (15 years ago)
- Branches:
- master
- Children:
- a4f5200, b87af8a
- Parents:
- 9d030cb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/com/example/helloandroid/GameView.java
r9d030cb r3a0d468 81 81 82 82 int mFleetSize; 83 84 public boolean connectionStarted; 85 public String connMessage; 83 86 84 87 public DrawingThread(SurfaceHolder surfaceHolder, Context context, … … 107 110 108 111 mFleetSize = 50; 112 113 connectionStarted = false; 114 connMessage = ""; 109 115 } 110 116 … … 346 352 } 347 353 } 348 354 355 //draw the fleet size bar on the bottom of the screen 349 356 float textSize = mTextPaint.getTextSize(); 350 357 mTextPaint.setTextSize(24); … … 355 362 356 363 mTextPaint.setTextSize(textSize); 357 364 358 365 mLinePaint.setColor(Color.YELLOW); 359 366 canvas.drawRoundRect(new RectF(70, mCanvasHeight-15, mCanvasWidth-70, mCanvasHeight-5), 5, 5, mLinePaint); … … 361 368 mLinePaint.setColor(Color.GREEN); 362 369 canvas.drawRoundRect(new RectF(70, mCanvasHeight-15, 70+(mCanvasWidth-140)*mFleetSize/100, mCanvasHeight-5), 5, 5, mLinePaint); 370 371 //draw connection info 372 if(connectionStarted) { 373 canvas.drawText(connMessage, (mCanvasWidth-mTextPaint.measureText(connMessage))/2, mCanvasHeight-200-(metrics.ascent+metrics.descent), mTextPaint); 374 } 363 375 } 364 376
Note:
See TracChangeset
for help on using the changeset viewer.