How can I load a image without add html element?
I'm making a game with typescript. Right now, I'm stopped by loading image.
We can use HTML to load image, and then use 'document.getElementBy()' but It will let code be too unclean:
<img src = "...">
<!-- What if a need hundred of image here? -->
And I don't want to switch to html tab every time, after I typed in , I don't need html anymore, and leftover are all done by typescript.
Are there any way to load image in javascript / typescript only?
LoadImage("...") // and gives you a image
ps: I don't want css too because it's even worse.