I like PIXI.js as it is really easy to use, yet is really powerful.
I made this Game with it in 48 hours for ludumdare (doesnt work in mozilla, which is a fault in my code not pixi's)
Answer from woverton on Stack OverflowWhat is the best 2d graphic library for javascript? - Stack Overflow
Best javascript library/ framework for developing 2D game Website
Best library for 2d graphic?
Which JavaScript graphics library has the best performance? - Stack Overflow
Hi, I’m working on a 2D board game website that’s not real-time, where players move tokens around the board based on various rules. I’m proficient with React, and I’m wondering if it’s the right choice for building this type of game, or if I should consider a game-specific framework like Phaser.js or just use plain JavaScript with Canvas.
The game will have customizable features like token placement, movement, and the number of tokens. I’d like to know what others think would be the best approach to develop this type of game and handle these customizations.
Any advice on frameworks/libraries or even game logic implementation tips would be much appreciated!
I'm working on a 2d game inside a 3d monitor and I think that using boxes with textures isnt very performance friendly in this scenario. I cant really find any specific 2d graphics for threejs or r3f and idk if cannon or rapier are good in this case.
Updated answer (2019):
The core advice is still the same: for maximal performance use thin wrappers or use raw browser API's, and also avoid the DOM or any DOM-like structure. In 2019 this means avoiding SVG (and any library built on top of it) because it may cause performance issues when trying to rapidly change the DOM.
Canvas is the go-to solution for high performance web graphics, both for the 2d and 3d (webgl) contexts. Flash is dead so no longer an option, but even if it weren't its performance was eventually matched by the native browser API's.
Original answer (2009):
If you're not doing 3d, just use raw canvas with excanvas as an explorer fall-back. Your bottleneck will be javascript execution speed, not line rendering speed. Except for IE, which will bog down when the scene gets too complex because VML actually builds a dom.
If you're really worried about performance though, definitely go with flash and write the whole thing in actionscript. You'll get an order of magnitude better performance, and with the flex sdk you don't even need to buy anything. There are several decent libraries for 3d in flash/flex available.
Raphael JavaScript Library
http://raphaeljs.com