Properties are the main value modification widgets in Nuklear.
Changing a value can be achieved by dragging, adding/removing incremental steps on button click or by directly typing a number.
Each property requires a unique name for identification that is also used for displaying a label. If you want to use the same name multiple times make sure add a '#' before your name. The '#' will not be shown but will generate a unique ID. Each property also takes in a minimum and maximum value. If you want to make use of the complete number range of a type just use the provided type limits from limits.h. For example INT_MIN and INT_MAX for nk_property_int and nk_propertyi. In additional each property takes in a increment value that will be added or subtracted if either the increment decrement button is clicked. Finally there is a value for increment per pixel dragged that is added or subtracted from the value.
| Function | Description |
|---|---|
| nk_property_int | Integer property directly modifying a passed in value |
| nk_property_float | Float property directly modifying a passed in value |
| nk_property_double | Double property directly modifying a passed in value |
| nk_propertyi | Integer property returning the modified int value |
| nk_propertyf | Float property returning the modified float value |
| nk_propertyd | Double property returning the modified double value |
Integer property directly modifying a passed in value
| Parameter | Description | |||
|---|---|---|---|---|
| Must point to an previously initialized nk_context struct after calling a layouting function | |||
| String used both as a label as well as a unique identifier | |||
| Minimum value not allowed to be underflown | |||
| Integer pointer to be modified | |||
| Maximum value not allowed to be overflown | |||
| Increment added and subtracted on increment and decrement button | |||
| Value per pixel added or subtracted on dragging |