棋子显示不正常
只有白色棋子,黑色不显示
只有白色棋子,黑色不显示
2017-02-04
在绘制棋子的方法里,看看加粗字体mBlackPiece有没有写错成mWhitePiece
private void drawPieces(Canvas canvas)
{
for (int i = 0, n = mWhiteArray.size();i<n; i++)
{
Point whitePoint =mWhiteArray.get(i);
canvas.drawBitmap(mWhitePiece,
(whitePoint.x+(1-ratioPieceOfLineHeight)/2)*mLineHeight,
(whitePoint.y+(1-ratioPieceOfLineHeight)/2)*mLineHeight,null);
}
for (int i = 0, n = mBlackArray.size();i<n; i++)
{
Point blackPoint =mBlackArray.get(i);
canvas.drawBitmap(mBlackPiece,
(blackPoint.x+(1-ratioPieceOfLineHeight)/2)*mLineHeight,
(blackPoint.y+(1-ratioPieceOfLineHeight)/2)*mLineHeight,null);
}
}
举报