Hey /g/. I'm trying to make a comic viewer in javascript using html5's <canvas> element. When the user clicks on the canvas, it loads the next panel, instead of the next page (each panel is its own image file). After the page has shown all its panels, it clears the canvas so it can show the next page and its panels. I'm doing it this way instead of using .attr and simply changing the page's src because I wanna put some effect on some panels. Make one shake when something heavy falls on the ground, make another one a webm instead of a jpg, etc.
Now, what I'm worried with is, wouldn't it be too performance heavy? The function to clear the canvas, clearRect, doesn't really clears anything, just covers it all up with a rectangle. So on the same page, below all those rectangles there would be hidden like 50 images, plus some webm's, and I wanted to make it work on mobiles as well. Also, if the user were to go back a page it would've to clear again and re-insert the previous panels. pls help, /g/, I don't know much about html5 or js, I literally stated studying about it only 3 days ago.
tl;dr: comic viewer using canvas possibly too heavy due to clearRect(). solution?
use a proper programming language
>>56313237
it's for the web, senpai
>>56313216
>girl
That artist doesn't do girls.
>>56313255
If that's poju, and i have the feeling it is from looking at that,
poju does do girls as well numbnuts.
>>56313216
>>56313237
source please
>>56313216
Nobody fucking cares about your obnoxious effects. This would be a good way to piss people off.
>>56313255
>>56313310
I have no idea who the artist is but it says right in the image that it's a male crossdressing as female.
>少年愛の美学15
>THE 女装少年
>>56313216
You are completely wrong about "all the images being under the rectangle and taking up resources." Do you think that if you draw the same image 5000 times that there will be 5000 instances of the image around? Because that is not the case.
>>56313216
Unless you plan on doing some real fancy shit clearRect is not going to be much of a problem and if you do you shouldn't be using canvas in the first place.
On a side note, you can't really think of canvas having layers. It's just a bitmap, once you paint something over what was there it's gone. The image is still loaded in the browser, but given the high-level nature of javascript that's non of your concern. Leave that to the browser.
>>56313310
Po-ju does make girls but it's very rare.
Blue board
>>56313216
http://na.leagueoflegends.com/en/site/poppy-comic/
>>56313422
It works for visual novels. But I'm not even sure if I'm gonna put this shake effect, it was just an example. Being able to use webm is the main reason I wanna do this way, actually.
>>56313470
I know they would be stored in the cache, so there wouldn't be need to download the same image again, it would simply reference that image's memory address. But the same image would be displayed n times in a single page, and that number could grow to infinite if, say, the user were to advance a page then go back a million times. Surely, that would take up resources, wouldn't it? But even ignoring this re-draw problem, there would still be about 60 unique images and webm's on the page.
>>56313542
>On a side note, you can't really think of canvas having layers. It's just a bitmap,
is this true? If so, then it should be all good then.