#How to add background to this code using canvas
23 messages · Page 1 of 1 (latest)
just for clarity, the background is supposed to be an image, which is already in my VSCode
does background not work on canvases?
seems to work fine
I may be dumb, but this seems to be CSS?
you have to do everything on the canvas?
everything is a big word, but inserting an image like that, ye? I've tried something with the constructor but that did not work
have you checked out this article? i found it from searching "canvas image"
Until now we have created our own shapes and applied styles to them. One of the more exciting features of is the ability to use images. These can be used to do dynamic photo compositing or as backdrops of graphs, for sprites in games, and so forth. External images can be used in any format supported by the browser, such as PNG, GIF, or JPEG. Yo...
mdn is a very good resource for web stuff, including js
it's the de-facto standard
How would I go about adding some inline css module into this?
you would put style="background: url('...')" in the canvas element in html, or you would assign canvas.styles.background = "url('...')"; in js