int currentX = maze.getCurrentX(),currentY = maze.getCurrentY(); //繪製球我想使用自定義png代替canvas.drawcircle函數。怎麼辦?
canvas.drawCircle((currentX * totalCellWidth)+(cellWidth/2), //x of center
(currentY * totalCellHeight)+(cellWidth/2), //y of center
(cellWidth*0.45f), //radius
ball);
//draw the finishing point indicator
canvas.drawText("F",
(mazeFinishX * totalCellWidth)+(cellWidth*0.25f),
(mazeFinishY * totalCellHeight)+(cellHeight*0.75f),
ball);
}
把png放到你的資源文件夾中,並將它設置爲你的視圖上的背景可繪製 – 2014-08-30 18:41:31