top | item 16480503

Konva – HTML5 2d canvas library for desktop and mobile applications

237 points| lavrton | 8 years ago |konvajs.github.io

35 comments

order
[+] rypskar|8 years ago|reply
We are using Konva for simple education games and the game editor at https://learnplayground.com and are mostly happy with it. It is easy to work with, the documentation is good, and so far supports all our use cases. The only drawback is some performance issues with animations on some browsers which we are not sure if we can fix by optimizing our code.

We have been using Konva for 2 years and would probably have chosen it again if we where going to start developing today

[+] laurent123456|8 years ago|reply
Do you also target mobile browsers by any chance and, if so, is the lib fast enough?
[+] scraft|8 years ago|reply
I have used Phaser to make games using HTML5 + TypeScript. It was my first attempt of doing a browser game and I found it pretty decent to use.

https://phaser.io

I don't have the final build of the project I made with it publicly visible, but an older build:

https://total-tetris.herokuapp.com

Supports mobile (touch controls) and desktop (keyboard controls). Final version has Facebook leaderboards.

I had one or two issues with Phaser which I supplied fixes for which were merged.

If I made a similar project, I would check out latest alternatives but wouldn't hesitate to use Phaser again.

[+] chatmasta|8 years ago|reply
Man, very well done. That’s the best html game I’ve played on mobile. Super addicting, and the radiators are an interesting twist! My strategy was to hold them until I get a heated floor.
[+] pmx|8 years ago|reply
I was actually enjoying that game until the radiator turned up! haha
[+] JCSato|8 years ago|reply
I'm curious: How does this compare to something like Pixi?
[+] stevejohnson|8 years ago|reply
Cool! This is a superset of some things people misuse Literally Canvas[1] for. I look forward to pointing people toward it when they ask about these kinds of features.

[1]http://literallycanvas.com

[+] antoineMoPa|8 years ago|reply
I like the fact that there are plenty of demos!
[+] Niksko|8 years ago|reply
Really great, thanks for the resource!

I've had ideas in the past for websites or projects where I would have wanted to use HTML5s canvas, but I haven't ever known where or how to get started. The demo here seemed very straightforward and easy to understand.

EDIT: Upon further consideration, this will actually be perfect for an upcoming project that I've been neglecting for a while due to not knowing how to do the drawing aspect. And it works with React ️

[+] wes-k|8 years ago|reply
Anyone able to compare this with http://paperjs.org/? In the past I've used Paper.js and have been very happy with it. It looks like Konva has a very similar set of features.
[+] Raed667|8 years ago|reply
I have used Konva to make a 2D map engine in my last job. It was a good dev experience.
[+] RobertRoberts|8 years ago|reply
This is pretty neat, does anyone have any other similar or equivalent libraries to compare this against? It's always nice to see comparisons to gauge the value of a feature or system structure. Thanks!
[+] nuclearcookie|8 years ago|reply
Can anybody explain this: "High performance event detection via color map hashing"? Any resources that explain this concept?
[+] finchisko|8 years ago|reply
Wondering if Konva could be used for UI rendering (imagine flutter/Skia for web). And if it could be faster then DOM.
[+] alex7o|8 years ago|reply
Skin is already the canvas backend for all the popular browsers, so no need to use anything.
[+] fenwick67|8 years ago|reply
WebGL would be faster than Canvas.
[+] lewispollard|8 years ago|reply
The demo on the front page says "Try to drag a star", but when I do, nothing happens.
[+] mcintyre1994|8 years ago|reply
That's odd - works well for me on my laptop both click+drag and from the touch screen.
[+] jiojfekjl|8 years ago|reply
Nitpicking: The stars don't do anything when I click them. Only when I start to drag them do I get any kind of visual feedback that something happened (they scale up)

Not sure if that's intentional. I'm on Firefox.

[+] gigatexal|8 years ago|reply
Can this be packaged as a single exe and can you make calls outside to like the file system or network?
[+] icebraining|8 years ago|reply
This seems to be purely a visual library; I'm assuming it can be run on Electron or similar platforms, which do allow you to access the file system and network.