Nuklear icon indicating copy to clipboard operation
Nuklear copied to clipboard

skinning example is bad at skinning

Open ghost opened this issue 4 years ago • 8 comments

input: running make in the example directory

cc -std=c99 -pedantic -O2 -o bin/skinning skinning.c -lglfw -lGL -lm -lGLU -lGLEW

output:

ghost avatar Apr 16 '21 22:04 ghost

Everything is correct here. The skinning example uses a low resolution skinning file, that was posted for demonstration purposes in 2016.

AFAIK most Nuklear users use the default way of drawing the UI, which does not involve pixel mapped files. As such, no one bothered to include a better skinning demonstration. The current one is sufficient I think for the purposes of explaining skinning functions.

Personally, with icons from Font Awesome or Project clarity and a style editor for all the nk_style_XXX options, I never needed to go to pixel mapped skinning to make the UI look good.

FrostKiwi avatar May 16 '21 16:05 FrostKiwi

gwen.png is a consistent resolution, its use within the skinning example is not! compare the resolution difference in the screenshot between:

  • the window's bottom scrollbar button and the bottom-right window corner.
  • any scrollbars' edges vs the scrollbars' buttons
  • the top and bottom vs left and right progress bar edges

none of these differences are observed in the gwen.png skinning file, and are only correct behavior for a skinned UI by means of parody. furthermore, arguments toward not using a feature are not an argument in defense of a feature.

so, example 3 looks pretty good, what's up with 4?

ghost avatar May 24 '21 02:05 ghost

@floopfloopfloopfloopfloop Now I'm starting to understand what you mean. The only information from your original post was "skinning example is bad at skinning", but this makes it more clear now with what your concerns are.

I will look into the current state of skinning. Possibly this relates to skinning being resolution dependent and this excellent PR already clears this up.

FrostKiwi avatar May 24 '21 08:05 FrostKiwi

@floopfloopfloopfloopfloop I checked out the example. The issue is indeed, that skinning is resolution dependent. Eg. Window style in that skin is sized to be 127x104 and gets stretched if a different size is applied. If the window size is closer to the skin size, it looks fine: Screenshot from 2021-05-24 14-05-33 Once the 9-slice PR get's merged, I'll create a good looking Skinning demo, that is resolution / size independent.

FrostKiwi avatar May 24 '21 10:05 FrostKiwi

@floopfloopfloopfloopfloop I checked out the example. The issue is indeed, that skinning is resolution dependent. Eg. Window style in that skin is sized to be 127x104 and gets stretched if a different size is applied. If the window size is closer to the skin size, it looks fine: Screenshot from 2021-05-24 14-05-33 Once the 9-slice PR get's merged, I'll create a good looking Skinning demo, that is resolution / size independent.

The 9-slice PR has been merged in #304. Just in case this was missed.

aganm avatar Oct 25 '21 07:10 aganm

Thanks for the work on 9-slice. Any chance there could be a simple example of how to utilize it in comparison to the original skinning method?

jordansavant avatar Jun 10 '22 13:06 jordansavant

Thanks for the work on 9-slice. Any chance there could be a simple example of how to utilize it in comparison to the original skinning method?

An important point for Nuklear 5.x. I'll push a PR this week addressing styling in it's entirety, including a proposal for a new default style and a file where users may edit the default style elements or change effects like baked soft shadows. All thanks to the awesome 9-slice PR by @Michael-Kelley and @dav64.

I'll create a good looking Skinning demo, that is resolution / size independent.

I failed to share this, because the style-guide I was porting to Nuklear turned out to be company internal and under NDA. With 5.x it's good timing, because it's something the community can edit collaboratively anyways.

FrostKiwi avatar Jun 12 '22 05:06 FrostKiwi

@floopfloopfloopfloopfloop Hope to address this in this community sourced Pull Request: https://github.com/Immediate-Mode-UI/Nuklear/pull/548

FrostKiwi avatar Feb 27 '23 17:02 FrostKiwi