search

Home  >  Q&A  >  body text

javascript - Using canvas to change pictures causes flickering problem.

When I use canvas to make a small game, there are pictures that need to be switched, and flickering occurs, but it doesn’t always happen, sometimes and sometimes not. What’s going on?

阿神阿神2760 days ago1047

reply all(2)I'll reply

  • typecho

    typecho2017-06-07 09:26:50

    It should be a picture loading problem. Just make sure it is loaded before drawing. It can be solved by using sprite, but making sprite is too troublesome

    reply
    0
  • 迷茫

    迷茫2017-06-07 09:26:50

    Solved: Make the picture into a sprite image. Just change the shearing coordinates when switching

    reply
    0
  • Cancelreply