add more icons

This commit is contained in:
John Alanbrook 2024-09-21 23:48:40 -05:00
parent 76036b30b5
commit bcad975c71
12 changed files with 64 additions and 6 deletions

View file

@ -2,6 +2,12 @@
The easily moddable, programming minded, 2D-first game engine. The aim is to make the fastest way to make games.
See the [documentation](doc/prosperon.org) for more information, including how to compile.
Using ...
* Sokol for rendering
* Chipmunk2D for physics
* imgui for easy editor UI
* Clay for game UI
Includes an implementation for Nota, and Kim.
*Prosperon is useful, but is a work in progress. Breaking changes are frequent.*

BIN
icons/compass.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
icons/crossed-swords.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
icons/dice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
icons/heart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
icons/random.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
icons/scorpion.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
icons/snail.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
icons/snake.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9 KiB

BIN
icons/trade.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View file

@ -1080,7 +1080,9 @@ Object.defineProperty(Array.prototype, 'empty', {
Object.defineProperty(Array.prototype, 'push_unique', {
value: function(x) {
if (!this.includes(x)) this.push(x);
var inc = !this.includes(x);
if (inc) this.push(x);
return inc;
}});
Object.defineProperty(Array.prototype, 'unique', {

View file

@ -81,16 +81,30 @@ JSC_SCALL(imgui_lineplot,
JSC_SSCALL(imgui_textinput,
char buffer[512];
if (JS_IsUndefined(argv[1]))
buffer[0] = 0;
else
strncpy(buffer, str2, 512);
ImGui::InputText(str, buffer, sizeof(buffer));
if (strcmp(buffer, str2))
ret = str2js(buffer);
else
ret = JS_DupValue(js,argv[1]);
)
JSC_SSCALL(imgui_textbox,
char buffer[512];
if (JS_IsUndefined(argv[1]))
buffer[0] = 0;
else
strncpy(buffer, str2, 512);
ImGui::InputTextMultiline(str, buffer, sizeof(buffer));
if (strcmp(buffer, str2))
ret = str2js(buffer);
else
ret = JS_DupValue(js,argv[1]);
)
JSC_SCALL(imgui_text, ImGui::Text(str) )
@ -145,6 +159,41 @@ JSC_SCALL(imgui_slider,
}
)
JSC_SCALL(imgui_intslider,
int low = JS_IsUndefined(argv[2]) ? 0.0 : js2number(argv[2]);
int high = JS_IsUndefined(argv[3]) ? 1.0 : js2number(argv[3]);
if (JS_IsArray(js, argv[1])) {
int n = js_arrlen(argv[1]);
float a[n];
js2floatarr(argv[1], n, a);
int b[n];
for (int i = 0; i < n; i++)
b[i] = a[i];
switch(n) {
case 2:
ImGui::SliderInt2(str, b, low, high);
break;
case 3:
ImGui::SliderInt3(str, b, low, high);
break;
case 4:
ImGui::SliderInt3(str, b, low, high);
break;
}
for (int i = 0; i < n; i++)
a[i] = b[i];
ret = floatarr2js(n, a);
} else {
int val = js2number(argv[1]);
ImGui::SliderInt(str, &val, low, high);
ret = number2js(val);
}
)
JSC_SCALL(imgui_checkbox,
bool val = js2boolean(argv[1]);
ImGui::Checkbox(str, &val);
@ -537,6 +586,7 @@ static const JSCFunctionListEntry js_imgui_funcs[] = {
MIST_FUNC_DEF(imgui, pushid, 1),
MIST_FUNC_DEF(imgui, popid, 0),
MIST_FUNC_DEF(imgui, slider, 4),
MIST_FUNC_DEF(imgui, intslider, 4),
MIST_FUNC_DEF(imgui, menubar, 1),
MIST_FUNC_DEF(imgui, mainmenubar, 1),
MIST_FUNC_DEF(imgui, menuitem, 3),