natiny_script_table_set

C
void natiny_script_table_set(NatinyScript script, NatinyScriptValue table,
                             const char* key, NatinyScriptValue value);

Writes a field of a table by name.

Parameters

Name Type Description
script NatinyScript The state the table lives in
table NatinyScriptValue The table to write to
key const char* Field name; must not be NULL
value NatinyScriptValue Value to store; string bytes are copied before the function returns

Example

C
natiny_script_table_set(script, config, "width",
                        natiny_script_make_number(1280));
natiny_script_table_set(script, config, "backend",
                        natiny_script_make_string("vulkan"));
natiny_script_table_set(script, config, "window",
                        natiny_script_make_handle(window));