import java.util.Timer;
import java.util.TimerTask;
-import de.cwde.shisensho.R;
-
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
+import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Paint.Cap;
surfaceHolder.addCallback(this);
}
+ public ShisenShoView(Context ctx) {
+ super((Context)ctx);
+ // silence lint?
+ }
+
private void paint(StatePaint pstate) {
this.pstate=pstate;
repaint();
tileWidth = tileset.getWidth()/tilesetCols;
tileHeight = tileset.getHeight()/tilesetRows;
tile = new Bitmap[tilesetRows*tilesetCols];
+
+ // align to screen
+ Matrix matrix = new Matrix();
+ matrix.setScale(1.0f, 1.0f); // FIXME!
+
+ // TODO: go on.
+
int k=0;
for (int i=0; i<tilesetRows; i++) {
for (int j=0; j<tilesetCols; j++) {
- tile[k] = Bitmap.createBitmap(tileset, j*tileWidth, i*tileHeight, tileWidth, tileHeight, null, false);
+ tile[k] = Bitmap.createBitmap(tileset, j*tileWidth, i*tileHeight, tileWidth, tileHeight, matrix, false);
tile[k].setDensity(Bitmap.DENSITY_NONE);
k++;
}
private void initializeGame() {
loadBackground();
- loadTileset();
screenWidth=getWidth();
screenHeight=getHeight();
+ loadTileset();
//undo.sensitive=false;
pstate=StatePaint.BOARD;
app.newPlay();
}
}
+ @SuppressWarnings("deprecation")
public void drawMessage(Canvas canvas, int x, int y, boolean centered, String message, String color, float textSize) {
Paint paint = new Paint();
paint.setColor(Color.parseColor(color));
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
}
*/
-}
\ No newline at end of file
+}