I am writing a game and for some reason not all bitmaps draw the Draw method in the heir from View:

@Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); timer.draw(canvas); background.draw(canvas); buttons.draw(canvas); board.draw(canvas); // Проблемный класс Paint mPaint = new Paint(); mPaint.setTextSize(30); DisplayMetrics displaymetrics = context.getResources().getDisplayMetrics(); canvas.drawText(score + "/" + symbols, (float) (displaymetrics.widthPixels * 0.05), (float) (displaymetrics.heightPixels * 0.1), mPaint); } 

The draw method in the problem class:

 @Override public void draw(Canvas canvas) { super.draw(canvas); firstSymbol.draw(canvas);// Sprite secondSymbol.draw(canvas);// Sprite thirdSymbol.draw(canvas);// Sprite fourthSymbol.draw(canvas);// Sprite minusFourthSymbol.draw(canvas);// Sprite minusThirdSymbol.draw(canvas);// Sprite minusSecondSymbol.draw(canvas);// Sprite minusFirstSymbol.draw(canvas);// Sprite } 

The draw method in the parent of the problem class:

 void draw(Canvas canvas) { board.draw(canvas);// Sprite symbol.draw(canvas);// Sprite } 

Sprite class draw method:

 public void draw (Canvas canvas) { Paint p = new Paint(); Rect destination = new Rect((int)x, (int)y, (int)(x + frameWidth), (int)(y + frameHeight)); canvas.drawBitmap(bitmap, frames.get(currentFrame), destination, p); } 

Sorry please if something is wrong with the question, I just registered.

  • Well ... Maybe you went beyond the borders of the screen and rendered it there? .. - Yuriy SPb
  • @YuriySPb I think not, since all the sprites move up the variables and it seems to me that only one of them is drawn. - roumaan

0