所以,我在屏幕顶部画了 3 个球。我正在使用表面视图。下面是绘图代码:
private void doDraw(Canvas c)
{
grid.Draw(c);
nextBallsBar.Draw(c);
}
网格:
public void Draw(Canvas c)
{
c.drawBitmap(Texture, 0, 0, null);
}
NextBallsBar:
public class NextBallsBar
{
private Bitmap ball1;
private Bitmap ball2;
private Bitmap ball3;
public void SetNextBalls(BallType[] ballTypes)
{
ball1 = BallTexturesProvider.GetBallTexture(ballTypes[0]);
ball2 = BallTexturesProvider.GetBallTexture(ballTypes[1]);
ball3 = BallTexturesProvider.GetBallTexture(ballTypes[2]);
}
public void Draw(Canvas c)
{
//Point _position = new Point((int) (400 * GameView.scaleX), (int) (42 * GameView.scaleY));
c.drawBitmap(ball1, (int) 200, (int) (42 * GameView.scaleY), null);
//_position = new Point((int) (_position.x - 60 * GameView.scaleX), _position.y);
c.drawBitmap(ball2, (int) 150, (int) (42 * GameView.scaleY), null);
//_position = new Point((int) (_position.x - 60 * GameView.scaleX), _position.y);
c.drawBitmap(ball3, (int) 100, (int) (42 * GameView.scaleY), null);
}
}
应该只抽出3个彼此分开的球。就像我的 WP7 版本一样。
怎么了 ?拜托,我希望你能帮助我!