top | item 34068070

(no title)

MCArth | 3 years ago

Tbh when making a web game you'd be better served using standard web UI in tandem with your game even if canvas text wasn't blurry.

Web libraries (react, etc) are very advanced and it'd be incredibly hard for a js game engine to match them for UI

discuss

order

naet|3 years ago

"Web libraries (react, etc)" are just using HTML and CSS / the standard DOM for rendering instead of Canvas. You don't need to use any "library" to render in that way, it's built into the browser.

My most recent web game uses both standard DOM and Canvas for rendering different parts of the UI and text, and both look equally good to me. You do have to have set up the Canvas rendering correctly, especially for sharper displays like Apple Retina displays with higher pixel densities, but when done properly it looks very sharp and has no issue IMO.

MCArth|3 years ago

Yup, but developer productivity with web library (e.g. react) > no library vanilla dom manipulation > canvas

dxhdr|3 years ago

Disagree; updating the DOM is incredibly slow and will kill your games performance.

MCArth|3 years ago

As long as you don't read your writes and use transform for animations it won't cost you more than 0.5ms to 1ms per frame (could it be better? Sure. But developer productivity is important.)

I use react in my game platform bloxd.io - which I work full time on - and I couldn't be happier

robust-cactus|3 years ago

Depends how often you're updating the DOM and how

aliswe|3 years ago

I think you underestimate the performance difference of canvas! Also, WebGL