Buttons and Fonts in Engine

I have recently started making a switch from the editor to using engine-only, and I encountered a few issues and I noticed that there is distinct lack of engine-only tutorials around. So my questions are:

I know how to add a text element as component, but no text is shown. I assume it’s because I need to attach a fontAsset. Is there a default fontAsset and if there isn’t, how do I add my own in engine-only?

At same time, how do I add a button that is just a colored rectangle, like how editor lets you do without using images, in engine-only?

This is correct. There is no default font asset unfortunately.

I can’t remember what bitmap font format PlayCanvas uses (probably something similar to http://www.angelcode.com/products/bmfont/).

However, you can download the assets from the editor after it converts the ttf that you upload to use in the engine.

The example from the GitHub repo may help as well here as well as supply some assets for fonts/buttons etc: https://github.com/playcanvas/engine/tree/master/examples/ui @maroko1011

1 Like