mirror of
https://github.com/Kapendev/parin.git
synced 2025-04-26 04:59:54 +03:00
22 lines
448 B
D
22 lines
448 B
D
/// This example shows how to use the text field.
|
|
|
|
import parin;
|
|
|
|
Str text;
|
|
char[32] textBuffer;
|
|
|
|
void ready() {
|
|
lockResolution(320, 180);
|
|
}
|
|
|
|
bool update(float dt) {
|
|
prepareUi();
|
|
setUiFocus(0);
|
|
// Create the text field and print if enter is pressed. Combos: ctrl+backspace, ctrl+x
|
|
if (uiTextField(Rect(resolution), text, textBuffer)) println(text);
|
|
return false;
|
|
}
|
|
|
|
void finish() { }
|
|
|
|
mixin runGame!(ready, update, finish);
|