Live data from Hacker News

Show HN: kiUi – Lightweight auto-layout stylable UI toolkit

novembermonk.github.io

21–30 of 44 posts

Re: Show HN: kiUi – Lightweight auto-layout stylable UI toolkit

#21
post #9

Earlier quoted context omitted.

It seems to be hardcoded natural scrolling - I'm getting it on a Windows desktop with a mouse wheel.

Still wrong. The scrolling direction is the opposite of your system settings. I have my mac set to "natural" scrolling and for me the demo scrolls conventionally.

Issue seems to come from Emscripten https://github.com/kripken/emscripten/issues/3171

Re: Show HN: kiUi – Lightweight auto-layout stylable UI toolkit

#22
post #8

I would love to see/experiment with light version of this.

If you want to strip it down, you can start by not compiling all the widgets you don't need as there are quite a lot of them. The renderer (glfw, NanoVG) takes about half of the dll size (~500kb) on windows.

Re: Show HN: kiUi – Lightweight auto-layout stylable UI toolkit

#23
post #20

How about IMGUI? https://github.com/ocornut/imgui

ImGui looks decent but is "designed and optimised to create debug tools." If you're building a game that doesn't look like a debug tool, you'll want to do some kind of skinning or at least make the UI fit into the aesthetic.

Also, FWIW -- here's ImGui running in the browser: http://floooh.github.io/oryol/ImGuiDemo.html

Re: Show HN: kiUi – Lightweight auto-layout stylable UI toolkit

#24
post #19

This is wonderful. Thank you for building this. Your emphasis on modern C++ and small dependencies is especially appreciated, especially in a world where an Emscripten bundle size matters. What's your rendering performance like, such as when you update 50 static text fields or images every frame?

Thank you. As to the draw calls, NanoVG draws everything directly each frame so this is constant whether or not you are updating. As to the overhead, not too long ago everything was updated each frame regardless of whether it was modified or not, and performance was fine. Worse than it is now, but okay. So I guess it could handle it.

But then again, that's only the default renderer. You can always roll your own and plug it in, kiUi has been designed to permit that.

Re: Show HN: kiUi – Lightweight auto-layout stylable UI toolkit

#26

How about IMGUI? https://github.com/ocornut/imgui

It's great and I actually borrowed ideas from his examples. Immediate mode and retained mode UIs are entirely different beasts though, with different targets / use cases. Something like dockable windows would be much harder to implement in a IMGUI lib

RM vs IM is entirely about where the name (id, pointer, whatever) of the widgets comes from. In RM it comes from the library, and is typically a pointer to some data that represents the 'widget', and in IM it comes from the user and is frequently a string or other local pointer (sometimes macros are used to generate IDs).

Anyway, there's no reason this would be harder to do in IM, other than that a lot of people are more familiar implementing RM than IM.

Re: Show HN: kiUi – Lightweight auto-layout stylable UI toolkit

#27
Many game developers seem to build their own UI libraries from scratch. Wouldn't it make sense to use Chromium Embedded Framework[0] or Awesomium[1] instead? I haven't used them myself (yet), but writing a UI in HTML+CSS sounds a lot easier than learning a new API.

[0] https://bitbucket.org/chromiumembedded/cef [1] http://www.awesomium.com

Re: Show HN: kiUi – Lightweight auto-layout stylable UI toolkit

#28
post #27

Many game developers seem to build their own UI libraries from scratch. Wouldn't it make sense to use Chromium Embedded Framework[0] or Awesomium[1] instead? I haven't used them myself (yet), but writing a UI in HTML+CSS sounds a lot easier than learning a new API. [0] https://bitbucket.org/chromiumembedded/cef [1] http://www.awesomium.com

[deleted]

Re: Show HN: kiUi – Lightweight auto-layout stylable UI toolkit

#29
post #27

Many game developers seem to build their own UI libraries from scratch. Wouldn't it make sense to use Chromium Embedded Framework[0] or Awesomium[1] instead? I haven't used them myself (yet), but writing a UI in HTML+CSS sounds a lot easier than learning a new API. [0] https://bitbucket.org/chromiumembedded/cef [1] http://www.awesomium.com

AAA studios use Flash.

http://gameware.autodesk.com/scaleform

Re: Show HN: kiUi – Lightweight auto-layout stylable UI toolkit

#30
post #27

Many game developers seem to build their own UI libraries from scratch. Wouldn't it make sense to use Chromium Embedded Framework[0] or Awesomium[1] instead? I haven't used them myself (yet), but writing a UI in HTML+CSS sounds a lot easier than learning a new API. [0] https://bitbucket.org/chromiumembedded/cef [1] http://www.awesomium.com

Writing UIs in HTML+CSS is only easy for people who know it already, to be honest. It's not a great UI layer.

I've been using it for almost 20 years now, and I'm still easily confused by the completely unintuitive interactions of CSS parameters like floats and clears, position:relative, box model nuances, etc. (I'm sure that someone is now itching to chime in and tell me I'm not a "real web developer", sort of like the argument on HN the other day about whether "real developers" are allowed to write
...)

Game development teams don't tend to include CSS wizards. Writing a new API can be a reasonable choice given the expertise available... Not to mention the substantial runtime overhead of loading a complete browser just to display some UI widgets.

Post reply on HN