How to add zui-library and font assets to a new project

Hi,

I have created an FPS counter on basis of the ui_script2d.
Now I created a new blender project and added the FPS parts from the ui_example.
Unfortunately the following code:

kha.Assets.loadFont("droid_sans", function(f:kha.Font) {
    ui = new Zui({font: f});
    armory.Scene.active.notifyOnInit(sceneInit);
});

doesn’t work, because the add-assets entries in khafile.js are missing.
Adding the zui-library and the droid_sans-font manually to the khafile.js doesn’t work, because the file is overwritten after klicking on “Play in Viewport” button in Blender.

Do I have to add those missing assets with Blender? If yes, how can I achieve that?

Hello,

Ah, right now it is super dumb and has to be enabled manually by checking Armory Player - Advanced - UI Library property, which will make it include necessary assets. This should be resolved in next build…

(There is also a way to manually append stuff into khafile.js by specifying a text file in Armory Project - Khafile. Working on final UI cleanup and then adding more docs on this.)

Is this resolved in armory4? I am trying to render image on a 3d UI but even after adding ‘addAssets’ in khamake.js I cannot refer that in trait script.

What is your error, missing font file? Try setting Armory Project - Modules - Zui from Auto to Enabled, that will make it always include font asset and the ui library.