Procedurally generated GUI

434 views Asked by At

I've developed an interactive audio visualization engine. I need to make its GUI scalable to various screen sizes with various PPIs (this includes both very large screens and mobile devices). Designer simply sent me a PSD with graphical representation of supported widgets. I'm exporting these into PNGs. The problem is that those bitmaps are of course not scalable and looks ugly.

I've thought about several ways how to achieve resolution and PPI independent GUI:

  • Export PNGs with various sizes and select the current set on runtime (waste of space simply for storing bitmaps in various resolutions)
  • Use scale 9 images only (no fancy stuff)
  • Use SVG (not supported by rendering APIs, could use smth like nanovg for OpenGL but what to do with raw framebuffer then?, also performance problems and too much complexity for what I need)

I came to an idea to pregenerate bitmaps at runtime for specific device once and use them afterwards. Are there any specific libraries for that and maybe already available themes which I could employ for now? I imagine tool could work similarly to how cairo graphics library or javascript canvas work by reading command list and outputting a bitmap. Any other ideas?

1

There are 1 answers

0
user206334 On

One possible solution is this:

CPlayer is a procedural graphics player with an IMGUI toolkit. It can be used for anything from quick demos, prototyping graphics apps, to full-fledged apps and games.

http://luapower.com/cplayer.html