Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8d11c1b
Add subpixel API.
itsuhane Jun 16, 2019
7965ce2
Merge pull request #1 from vurtun/master
itsuhane Jun 16, 2019
4aaad16
Merge branch 'master' into subpixel
itsuhane Jun 16, 2019
a61e94e
Add forward-declarations for subpixel-drawing APIs.
itsuhane Jun 16, 2019
e4133b7
Now detecting if memcpy and memset are actually needed. And same goes…
Nielsbishere Dec 4, 2019
0919f70
https://github.com/vurtun/nuklear/pull/803
Nielsbishere Dec 4, 2019
c9980c2
Merge branch 'fix_cpp17' of https://github.com/Nielsbishere/Nuklear i…
Nielsbishere Dec 4, 2019
dc951bf
Problem with existing PR was as follows:
Nielsbishere Dec 4, 2019
11aa9a3
https://github.com/vurtun/nuklear/pull/653 zhouxs1023's Modify the ap…
Nielsbishere Dec 4, 2019
842fd02
Fixed readme
Nielsbishere Dec 4, 2019
f4d97f5
Fixed logical mistake I made in readme
Nielsbishere Dec 4, 2019
014cd2d
Update nuklear_internal.h
Nielsbishere Dec 5, 2019
0de31b9
Update nuklear_util.c
Nielsbishere Dec 5, 2019
be3f371
Repacked nuklear.h and updated package.json
Dec 5, 2019
2c6afa7
Delete package-lock.json
Nielsbishere Dec 5, 2019
31492dc
Merged with fixed_cpp17
Dec 5, 2019
4ede715
Moved ctx to the stack
Dec 5, 2019
8e89387
Merge branch 'fix_click' of https://github.com/Nielsbishere/Nuklear i…
Dec 5, 2019
9f8a941
Merge with fix_click and bump version
Dec 5, 2019
871f277
Update changelog
Dec 9, 2019
15aff92
Fixed indenting and updated changelog
Dec 9, 2019
9b05321
Merge branch 'fix_click' of https://github.com/Nielsbishere/Nuklear i…
Dec 9, 2019
498c3c1
Updated changelog
Dec 9, 2019
7926983
Now refreshing nuklear.h everytime nuklear rebuilds
Nielsbishere Dec 11, 2019
6023f8d
Removing memset and memcpy functions if they don't exist anymore
Nielsbishere Dec 11, 2019
8ca23c3
Memset/memcpy
Nielsbishere Dec 11, 2019
2c6db66
Merge https://github.com/Immediate-Mode-UI/Nuklear into fix_cpp17
Nielsbishere Dec 11, 2019
2a415e8
Updated to work with clang
Nielsbishere Dec 11, 2019
792931d
Moved to linux line endings.
Nielsbishere Dec 12, 2019
9aa9729
Merge branch 'fix_cpp17' of https://github.com/Nielsbishere/Nuklear i…
Nielsbishere Dec 12, 2019
ccafa56
Merge branch 'fix_click' of https://github.com/Nielsbishere/Nuklear i…
Nielsbishere Dec 12, 2019
f7c0f03
Reverted checkboxes to the old looks; because imho it looks better
Nielsbishere Dec 12, 2019
adcadc9
Merge branch 'fix_radio_buttons' of https://github.com/Nielsbishere/N…
Nielsbishere Dec 12, 2019
dfa723e
nk_begin now returns an nk_window, so you can get the location and di…
Nielsbishere Dec 23, 2019
6ddf690
Added a way to callback when a window is closed or minimized.
Nielsbishere Dec 23, 2019
bd71866
nk_add_window now accepts an id instead of a name.
Nielsbishere Dec 23, 2019
1b2b0ee
Merge branch 'subpixel' into feature_return_window_on_begin
Nielsbishere Jan 19, 2020
9d2dea4
Updated package.json and changelog
Nielsbishere Jan 19, 2020
8e3b0ef
Fixed paq picking invalid python and thus failing.
Nielsbishere May 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 44 additions & 26 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,37 +59,55 @@ This is very important; not doing it either leads to compiler errors, or even wo
struct nk_context ctx;
nk_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font);

enum {EASY, HARD};
static int op = EASY;
enum { EASY, NORMAL, HARD };
static int op = EASY, active[3]{ 1, 0, 1 }, selected{};
static float value = 0.6f;
static int i = 20;

if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220),
NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
/* fixed widget pixel width */
nk_layout_row_static(&ctx, 30, 80, 1);
if (nk_button_label(&ctx, "button")) {
/* event handling */
}

/* fixed widget window ratio width */
nk_layout_row_dynamic(&ctx, 30, 2);
if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY;
if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD;

/* custom widget pixel width */
nk_layout_row_begin(&ctx, NK_STATIC, 30, 2);
{
nk_layout_row_push(&ctx, 50);
nk_label(&ctx, "Volume:", NK_TEXT_LEFT);
nk_layout_row_push(&ctx, 110);
nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f);
}
nk_layout_row_end(&ctx);
static size_t test{};

static char const * biomes[] = {
"Large biome",
"Small biome"
};

static int biomeCount = int(sizeof(biomes) / sizeof(biomes[0]));

if (nk_begin(&ctx, "Show", nk_rect(50, 50, 300, 350),
NK_WINDOW_BORDER|NK_WINDOW_SCALABLE|NK_WINDOW_MOVABLE|NK_WINDOW_TITLE)) {

// fixed widget pixel width
nk_layout_row_static(&ctx, 30, 150, 1);
if (nk_button_label(&ctx, "Play"))
myPlayFunction();

// fixed widget window ratio width
nk_layout_row_dynamic(&ctx, 30, 2);
if (nk_option_label(&ctx, "Easy", op == EASY)) op = EASY;
if (nk_option_label(&ctx, "Normal", op == NORMAL)) op = NORMAL;
if (nk_option_label(&ctx, "Hard", op == HARD)) op = HARD;

nk_layout_row_dynamic(ctx, 30, 2);
nk_checkbox_label(&ctx, "Silver", active);
nk_checkbox_label(&ctx, "Bronze", active + 1);
nk_checkbox_label(&ctx, "Gold", active + 2);

nk_layout_row_dynamic(&ctx, 30, 2);
nk_combobox(&ctx, names, biome_count, &selected, 30, nk_vec2(150, 200));

// custom widget pixel width
nk_layout_row_begin(&ctx, NK_STATIC, 30, 2);
{
nk_layout_row_push(&ctx, 50);
nk_label(&ctx, "Volume:", NK_TEXT_LEFT);
nk_layout_row_push(&ctx, 110);
nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f);
nk_progress(&ctx, &test, 100, 1);
}
nk_layout_row_end(&ctx);
}
nk_end(&ctx);
```
![example](https://cloud.githubusercontent.com/assets/8057201/10187981/584ecd68-675c-11e5-897c-822ef534a876.png)
![example](img/test%20window.png)

## Bindings
There are a number of nuklear bindings for different languges created by other authors.
Expand Down
Binary file added img/test window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading