javascript - How to set the z-index of drawImage in canvas
过去多啦不再A梦
过去多啦不再A梦 2017-05-19 10:34:14
0
1
1064

For example, I want the first drawImage picture to be drawn above the second one. Is there any way?
(without changing the position order of the two lines of code)
ctx.drawImage(bg, 0 , 0, w, h);
ctx.drawImage(jp, 0, 0, boxWidth, boxHeight);


Currently covering the prize

过去多啦不再A梦
过去多啦不再A梦

reply all(1)
巴扎黑

The canvas has no structure, no hierarchy, only first come, first served, and the later ones cover the previous ones.
If the hierarchical function is provided, it will only make the painting more confusing. .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!