
Ask HN: Alternative 2D or non-html non-DOM-based layout engines? - borplk
Are there alternatives out there to the typical HTML&#x2F;CSS for complex and high performance UI&#x2F;layout?<p>(Doesn&#x27;t have to be web based or in the browser)<p>Perhaps something based on 2D painting&#x2F;canvas.<p>Game and physics engines are so powerful. They can render so much visual detail with high frame rates.<p>I want that kind of rendering power applied to UI&#x2F;layout.<p>I can just paint a canvas in a loop like in a game, but that&#x27;s too manual and tedious for layout and text handling without things like box models and CSS.<p>Use cases are many but imagine an editor for scientific work where you need to render a visualisation of millions of particles and so on.<p>I know I can have some basic stuff in HTML&#x2F;CSS for example, and then stick that heavy stuff into a little box with WebGL and things of that nature.<p>I&#x27;m curious if there&#x27;s a nicer technology out there that&#x27;s basically as powerful as the fancy video game graphics, except it applies that power to layout&#x2F;grid&#x2F;UI&#x2F;GUI&#x2F;etc for use cases where the basic HTML&#x2F;CSS&#x2F;DOM is not enough.
======
billconan
Almost all ui systems have a layout engine.

[https://arxiv.org/pdf/1401.1031.pdf](https://arxiv.org/pdf/1401.1031.pdf)

[http://doc.qt.io/qt-5/layout.html](http://doc.qt.io/qt-5/layout.html)

They may be different from physics engine,

But there are already companies who have integrated physics into ui, such as

[https://www.raywenderlich.com/50197/uikit-dynamics-
tutorial](https://www.raywenderlich.com/50197/uikit-dynamics-tutorial)

~~~
billconan
there was also this kind of 3d ui,

[https://www.youtube.com/watch?v=M0ODskdEPnQ](https://www.youtube.com/watch?v=M0ODskdEPnQ)

[https://www.youtube.com/watch?v=6jhoWsHwU7w](https://www.youtube.com/watch?v=6jhoWsHwU7w)

[https://bumptop.github.io](https://bumptop.github.io)

[https://www.wired.com/2013/02/amazing-3d-desktop/](https://www.wired.com/2013/02/amazing-3d-desktop/)

they certainly used game/physics engine, but they didn't use it for layout.

------
marktangotango
It used to be a right of passage for indie gamedevs to implement ui frameworks
for their games. There were a whole bunch of them on the Internet for SDL,
allegro, OpenGL, etc...

Conversely, most gui frameworks provide an OpenGL widget you can build an app
around; qt, swing with jogl or lwjgl, etc. lots of options here.

------
PaulHoule
Use a game engine to build something that isn't a game.

~~~
borplk
But do they provide anything that would help me with layout/presentation?
(think something remotely like CSS, or flexbox)

Or do I have to make it all from scratch?

(Not familiar with game engines)

