In a 2D canvas, is there a way to give a sprite an outline?

前端 未结 3 572
刺人心
刺人心 2020-12-04 03:40

I\'d like to give a sprite an outline when the character gets healed/damaged/whatever but I can\'t think of a way to code this using the 2d canvas. If it were possible, I\'

3条回答
  •  一整个雨季
    2020-12-04 04:34

    You could use strokeRect method to outline the sprite after drawing it. It should be asy if you know your sprite's dimensions...

提交回复
热议问题