Show HN: kiUi – Lightweight auto-layout stylable UI toolkit
novembermonk.github.io
novembermonk.github.io
i.e weird scrolling (slow, direction), ghosting, crashing chrome, etc.
I was under the impression that this isn't really meant to be a web project, so the fact that LLVM is being imperfectly converted to JavaScript is probably the reason for most of these.
What's your rendering performance like, such as when you update 50 static text fields or images every frame?
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.
By comparison, a basic Emscripten libRocket demo takes 6-8ms (mostly due to Freetype rendering and its layout system, see http://forums.librocket.com/viewtopic.php?f=2&t=5223), and ImGui takes 1ms (probably due to its monospaced bitmap fonts and simple widgets, demo: http://floooh.github.io/oryol/ImGuiDemo.html).
Just some thoughts in case you're planning on adding complicated game logic every frame :)
I would like to think that for some UI projects that things like XAML(WPF/Silverlight) or Flex(Flash) would be some of the first things to reach for... IIRC there are similar tooling for building for GTK and QT applications. Why build your own?
After spending quite some time writing UI, I believe doing it in either XML or HTML is just pure madness.
UI is a very complex structure with complex wiring and interactions between components, and so it is very prone to human error. To represent such a complex system in anything else than a statically typed language like C++ is, to me, incredibly counter-productive.
You may like to write them in XML, but I want to write them in code and I wrote kiUi just for that. It's more concise, less error prone.
More essentially, I think it comes from a "fallacy" or "false dream" that a designer could design a reactive UI in XML or HTML without knowing anything about code.
The back of the coin, is that to code a real UI you need both HTML and javascript, or XML and another language. XML and HTML are just here for the layout.
But kiUi takes a rather different approach at layout, which is that you may not even need to specify layout in the first place. It's done for you already, but, the designer can still tweak it if needed.
So, kiUi inverted relationship of the primacy of layout over the rest. In kiUi the primacy is to the native code, and to the logical elements (the widgets).
The fact that it is XML is more convention in this case... even with React, it's translated to coded controls via strict rules.. and is relatively easy to manage and reason with.
You don't specify any absolute measurement when using kiUi from C++.
The whole point is to get rid of them. They are calculated under the hood.
The style gives the necessary hints. And this is done in a way entirely separate from the UI code itself.
Think of the C++ code doing what is regularly done in both HTML and Javascript, and the kiUi style sheet as what is regularly done in CSS.
1. it doesn't accept asian language inputs. 2. the scrolling direction doesn't respect my system settings. (I have unchecked natural scrolling direction on my mac)
I have my mac set to "natural" scrolling and for me the demo scrolls conventionally.
[0] https://bitbucket.org/chromiumembedded/cef [1] http://www.awesomium.com
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 <br/> ...)
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.
- Embedding a whole browser in your app just to display a few widgets is not my definition of "lightweight"
- Often coding UI in native code (C++) makes a lot more sense, integrate with exiting code in a much cleaner way
Game developpers would much less tend to build their own libraries from scratch, if there was at least one that satisfied all of these 'basic' requirements : lightweight, skinnable, auto-layout
Some of the benefits I see with HTML+CSS(+JS) based UI:
* Comprehensive feature set
* Easy prototyping
* Easy modding
* No recompilation required
* Web full of documentation & examples
* Common skill for developers/designers
The main disadvantage is probably the performance hit of having a full-blown browser engine in your game, but it seems to work OK for AAA games. I believe Anno 2070 uses Awesomium for some of its content: http://www.posidyn.com/games/anno2070/anno2070-09.jpgAnyway, 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.
Need to take a closer look if this happens to match my needs
I think many things in kiUi, especially the layout and style, can be seen as declarative, in a way.
But the individual widgets and interaction between them are not. And I'm curious as to how it could be different. Also you want to collaborate on something or just discuss, I'm interested.