Koui 2020.10 was released today!
Whats new?
- Support for gradients, drop shadows and rounded corners. Koui now has its own painter classes with custom shaders
- Massive theming improvements:
- It is now possible to style indiviual sub-elements (e.g. a slider background and the button in the foreground) differently
- Added “states” to theme definitions: Elements can now have different styles based on their state (
_button!hover
e.g.) - Support for global variables in the theme file (colors, etc.)
- When adding small tweaks to existing themes it is no longer required to copy the entire theme. Instead you can now append another theme on top of an already existing one (all that happens during compile time!). However, you can still overwrite the entire default theme with the
KOUI_THEME
define, just as before. - New data type
Asset
for theme files that will automatically load the required assets when Koui initializes
- Show more debug information to profile graphics performance when
KOUI_DEBUG_DRAWINGTIME
is set, you can now access the number of draw calls and the average drawing buffer size for Koui’s new painter (Kha’s g2/g4 calls are not taken into account) - Layouts that use anchor positions now have a default anchor. Added elements will use that anchor when
element.anchor == Anchor.FollowLayout
- Progressbars now can output their value as a percentage when using Haxe templates (
::percentage::
) - Faster window resize handling
- Much better theme handling of disabled elements
- Many bug fixes and smaller improvements
- More unit tests to improve stability
Just to make sure: there are always smaller updates that are not part of those big updates with their own version number. Only big breaking changes get their own version number.
Example project:
Because the documentation is not yet updated, I decided to upload one of my small example projects that I use for debugging (this one doesn’t use Armory, it’s pure Kha). It has no functionality other than showing a few elements as you can see in the screenshot above. It started as a game options menu but now it’s just something weird^^
To run it, open the extracted zip folder in VSCode/Kode Studio and hit F5
(you might have to choose Electron from a dropdown, but it should work on any other target as well).
Download demo project (this forum doesn’t allow .zip uploads): https://www.dropbox.com/s/c6dll34p49c0doy/KouiDemo.zip?dl=1
Have fun