Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6766649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:51:24+00:00 2026-05-26T14:51:24+00:00

I have an isometric map which I draw to the canvas. When I try

  • 0

I have an isometric map which I draw to the canvas. When I try and move the map around, these black lines flicker in between some of the tiles making the whole thing look rather shoddy.

Here is the relevant code from my updating thread

public void run() {
    Canvas c;
    while (isRunning){
        c = null;
        try {
            c = cellMap.getHolder().lockCanvas(null);
            synchronized (cellMap.getHolder()) {
                cellMap.onDraw(c);
            }
        } finally {
            if( c != null){
                cellMap.getHolder().unlockCanvasAndPost(c);
            }
        }
    }
}

and from my CellMap class (which extends SurfaceView):

    public void onDraw(Canvas canvas){
    canvas.drawColor(Color.BLACK);
    int x = 0;
    int y = 0;

    for(int i = 0; i < mapSize; i++){
        for(int j = 0; j < mapSize; j++){
            x = (i-j) * 30 + xOffset;
            y = (i+j) * 15 + yOffset;
            mapCells[i][j].draw(canvas, paint, x, y);
        }
    }

mapCells[][] is an array of objects which contain the Bitmap image that needs to be drawn. The draw() function is only 1 line canvas.drawBitmap(bitmapImage, x, y, null)

I have discovered that removing the line Canvas.draw(Color.black) gets rid of the flicker. However, when I move the map the canvas is not cleared so I still see the image from the previous frames. I’d imagine it is because it is taking too long to draw the bitmaps? but the map is only very small at the moment.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:51:25+00:00Added an answer on May 26, 2026 at 2:51 pm

    I found the problem. When moving the map, the offset values were being changed. This lead to sections of the map being drawn temporarily with different offset values – creating the tearing. duh!

    I solved this by copying the xOffset and yOffset values at the start of the onDraw() method, and using those values for the update.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic isometric map with some sprites loaded on the map in
Have some validating problems which seem to appear only when using the Auth component.
Yo everyone! I have been working on an Isometric Tile Game Engine in HTML5/Canvas
In my isometric flash game I have some models with long shadows. I want
Is there a simple way to have isometric projection? I mean the true isometric
My problem is I Have an isometric grid, just based on the X,Y values:
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.