[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Comic viewer for HTML5 in JS

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 14
Thread images: 4

File: cute girl's ass.jpg (195KB, 1384x1391px) Image search: [Google]
cute girl's ass.jpg
195KB, 1384x1391px
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?
>>
File: fat.jpg (189KB, 687x746px) Image search: [Google]
fat.jpg
189KB, 687x746px
use a proper programming language
>>
>>56313237
it's for the web, senpai
>>
File: 1250624792258.jpg (47KB, 405x464px) Image search: [Google]
1250624792258.jpg
47KB, 405x464px
>>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/
>>
File: boys.png (385KB, 1195x744px) Image search: [Google]
boys.png
385KB, 1195x744px
>>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.
Thread posts: 14
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.