redrawing canvas html5 without flickering

前端 未结 2 901
心在旅途
心在旅途 2020-12-20 20:15

I\'ve a screen being redraw every 25ms, and images are flickering, here is my code

                var FRAME_RATE = 40;
                var intervalTime = 10         


        
2条回答
  •  渐次进展
    2020-12-20 20:35

    Load all images and other data before draw and storage them inside array.
    Better use requestAnimationFrame.
    Remember, getting JSON (or other data) can take some time.

提交回复
热议问题