How to draw lots of bitmaps on screen in an Android game without slow performance

前端 未结 6 1998
一个人的身影
一个人的身影 2020-12-28 20:32

I want to make a tile based game for android. At the moment I am drawing each tile as a separate bitmap. I have a big for loop that reads from a string and draws different

6条回答
  •  我在风中等你
    2020-12-28 20:49

    How about moving the whole view when the user scrolls. When you scroll in windows, you actually move the window in the opposite direction that you perceive. You scroll down, the windows moves up..

    I am quite sure you could collect all the elements in a view (grid) and move the whole view.. Render images off screen (faster) and move them up as needed..

    There are examples available.. I know you can get all the code for the home screen, and it scrolls left to right. Might be something to look into. I'm quite sure they did that app right.

提交回复
热议问题