HTML5 Canvas set z-index

后端 未结 5 1269
陌清茗
陌清茗 2020-12-01 07:48

Is it possible to set the z-index of a drawn object in HTML5 canvas?

I am trying to get it so one object can be infront of a the \"player\" and another object is beh

5条回答
  •  猫巷女王i
    2020-12-01 07:59

    Sorry, but nope, the canvas element will have its z-index and anything drawn on it will be on that layer.

    If you are referring to different things on the canvas then yes, anything that is drawn is drawn on top of whatever was there before.

提交回复
热议问题