Hi, been trying to place an image on top of the GameCanvas in order to utilize the style image-rendering: pixelated.
However, the image-element always goes underneath the GameCanvas. See image:
z-index doesn't matter, and element placement within the body doesn't matter either.
And since I am adding the element with javascript and gonna be editing the element with javascript, that's why I'm posting here. I think it should be relevant 😛
Other solution would be to draw the image directly on the canvas, but I've had no luck with this. It just says that context.drawImage() is not a function. Which is rather strange, but okay.
And yet another solution would be if I could change the scaling function of pictures to be nearest neighbor rather than the blurry messes it produces at the moment.
Any response and/or help on this would be greatly appreciated! 🙂
Edit:
Decided to make the base image larger rather than small and then shrink it rather than sizing it up. Should fix the blur. The topic is still interesting to figure out though as I've often wondered about this.
However, the image-element always goes underneath the GameCanvas. See image:
z-index doesn't matter, and element placement within the body doesn't matter either.
And since I am adding the element with javascript and gonna be editing the element with javascript, that's why I'm posting here. I think it should be relevant 😛
Other solution would be to draw the image directly on the canvas, but I've had no luck with this. It just says that context.drawImage() is not a function. Which is rather strange, but okay.
And yet another solution would be if I could change the scaling function of pictures to be nearest neighbor rather than the blurry messes it produces at the moment.
Any response and/or help on this would be greatly appreciated! 🙂
Edit:
Decided to make the base image larger rather than small and then shrink it rather than sizing it up. Should fix the blur. The topic is still interesting to figure out though as I've often wondered about this.