Can I put multiple backgrounds on a canvas | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Can I put multiple backgrounds on a canvas

So i am making a platform game with Html, CSS, and JavaScript, and I need to put A LOT of background-images on my canvas, 350 to be exact. I can do it but the issue is that I need them all to have the same height and width, 50px or 15 canvas units. I need a way of sizing and positioning each background-image. I can do it either with CSS or JavaScript; I do not care.

23rd Feb 2021, 6:03 PM
bob
bob - avatar
3 Antworten
+ 2
bob I was pleased to be able to help you. Happy coding.
23rd Feb 2021, 8:42 PM
JaScript
JaScript - avatar
+ 1
JaScript, you TOTALLY just solved a problem I have been trying to fix for a week. Thank you sooo much.
23rd Feb 2021, 7:50 PM
bob
bob - avatar