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
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. .