vurtun / nuklear

A single-header ANSI C gui library
13.68k stars 1.1k forks source link

Themeing/gamepad samples #155

Open andres-asm opened 8 years ago

andres-asm commented 8 years ago

Hey again,

Just finished re-adapting my code to nuklear, quite a few things changed apparently. I'm wondering if you have sample code for these:

25df939e-f6b3-11e5-8587-b19e863e0d1b

339926a8-0d9c-11e6-9fee-a8b73af04473

I can figure out the gamepad sample from the one you gave me before, but I thought i'd still ask, maybe you have something ready.

vurtun commented 8 years ago

Sorry I removed or overwrote all theme demos. This was at the time of the release version and I just really wanted to get things done so I saved nothing and overwrote everything. The reasoning at that time was that I could not release it anyway since I don't think I am allowed to upload the actual styles. I wish I could say that skinning is easy but it took me a shit ton of time to collect UI styles and a few hours each demo to fine tune all configuration inside the library to make it look good (it takes less time now since I also had to fix stuff at that time).

As for the gamepad demo I am currently working (as of this time of writing) on a cleaned up up to date version. I will report back as soon as I have an updated version done and post it.

andres-asm commented 8 years ago

Thanks a lot

On Sat, May 28, 2016, 12:20 PM Micha Mettke notifications@github.com wrote:

Sorry I removed or overwrote all theme demos. This was at the time of the release version and I just really wanted to get things done so I saved nothing and overwrote everything. The reasoning at that time was that I could not release it anyway since I don't think I am allowed to upload the actual styles. I wish I could say that skinning is easy but it took me a shit ton of time to collect UI styles and a few hours each demo to fine tune all configuration inside the library to make it look good (it takes less time know since I also had to fix stuff at that time).

As for the gamepad demo I am currently working (as of this time of writing) on a cleaned up up to date version. I will report back as soon as I have an updated version done and post it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vurtun/nuklear/issues/155#issuecomment-222319491, or mute the thread https://github.com/notifications/unsubscribe/ABpC0CdY3R6828UFlN5zklKadPcpfHN-ks5qGHlUgaJpZM4Io_AL .

r-lyeh-archived commented 8 years ago

Have you thought about GWEN skinning style (one texture)? http://i.imgur.com/Im34UOs.png?1 If you want to support different button sizes as well, then maybe add a json/ini file with rect definitions on it

vurtun commented 8 years ago

@r-lyeh Thanks for the link I added an example that uses it.

In general it seems that doing skinning by code is still quite a pain. I should really think about a format to parse configuration/color/skinning out of.

dumblob commented 8 years ago

In general it seems that doing skinning by code is still quite a pain. I should really think about a format to parse configuration/color/skinning out of.

This will be quite difficult. Let me briefly show why. There are 2 main goals to achieve:

  1. rapidly ease creation of graphics (e.g. vector and bitmap images) for Nuklear by using some standardized (i.e. predefined) existing format
  2. let programmers do skinning fully on their own (someone may want to implement support for Gnome, other for KDE, other for game X, other for Android, other for iOS, another for Windows 10 and yet another for good old Windows XP themes)

Both goals go somewhat against each other, so it would make sense to support both - a low-level skinning interface like now (of course it could be improved, but currently it seems sufficient) and also some abstraction being closer (just optimized internal representation structures for a subset of the functionality - i.e. rather no parsing of the skinning format, no complex precomputation nor caching, etc.) to some chosen intersection of existing most comprehensive and modern enough skinning formats (which might be difficult, becase vast majority of them support just bitmaps and no vector images :cry:).

Option 1. is basically "yet another format" - there are hundreds of skinning formats mutually incompatible (just because of lack of good abstraction as allowed by option 2.) and we could easily end up with something like https://github.com/sp4cerat/Game-GUI .

Don't forget about maintenance which will be very demanding, because skinning formats change every week (e.g. Gnome guys are famous exactly for this) and by definition will never become stable (graphics and skinning changes extremely rapidly - look e.g. at Android).

In general I'm quite afraid of this functionality as it seems more complex than e.g. recording (which among other things sounds like the best solution for "smart caching" if the recorded structure were a rectangle acting as a bounding box for some content). Therefore I would rather see skinning in some example first and based on the complexity and code abstraction needs decided what should be put directly to zahnrad.h if anything and what should remain just in the example (i.e. up to the programmer).

andres-asm commented 7 years ago

Hey @vurtun Just checking if you ever managed to re-do the gamepad demo?