Skip to content
Discussion options

You must be logged in to vote

You really know how to pick one of the more awkward things to do in Nuklear don't you? Sorry for the slow reply, as you can see we don't use discussions much.

What you have is definitely more complicated than necessary. Centering things vertically is always a bit of a pain in Nuklear, but since Nuklear is row based, you centering things horizontally is easier.

Also you should rarely have to call font->width() manually, especially for something simple like this. Usually you just pick a pixel width that works, or possibly a fraction if you're doing one of the nk_layout_row_xxx or nk_layout_row() methods.

I can think of a couple ways to do this. One is to use nk_layout_space*():

    const in…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@TomJGooding
Comment options

@TomJGooding
Comment options

@rswinkle
Comment options

Answer selected by TomJGooding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants