A simple single-line box for string entries
You should rather use https://github.com/mh-cz/gmtf
it's faster and has more stuff in it
Fixed: keyboard_string not being cleared before focus
- mouse selection
- double click to select a whole word
- overwriting selected text
backspace/delete
ctrl + a
to select everythingctrl + c/x/v
copy, cut, pastectrl + backspace
to delete a whole wordctrl + left/right arrows
to skip a whole word- switching between connected boxes with up/down arrows
- character limit
- width limit
focus()
- force focuscopy_look(from)
- steal the look of another inputboxdraw(x, y, gui=true)
- position x, position y, ifgui
is true GUI mouse position will be usedget_text(with_case=false)
- get the string inside. if with_case is true it will return text affected by lcase/ucaseset_text(text)
- overwrite the text inside
ib_next
(inputbox id) - focus this one when presseddown
ib_prev
(inputbox id) - focus this one when pressedup
highlight_color
(color) - mouse selection colorhighlight_alpha
(real) - mouse selection alphaline_color
(color) - color of the line below the boxline_alpha
(real) - alpha of the line below the boxbkg_color
(color) - background color (unfocused)bkg_alpha
(real) - background alpha (unfocused)bkg_color_focused
(color) - background color (focused)bkg_alpha_focused
(real) - background alpha (focused)font
(font) - fontwidth
(real) - width of the input areaheight
(real) - height of the input arealcase
(bool) - force drawing in lowercaseucase
(bool) - force drawing in uppercase (will overwrite lcase if both are true)char_limit
(real) - limit the number of characterswidth_limit
(bool) - do not allow the text to go over the right border
/// CREATE EVENT
ib1 = new inputbox("Hi there");
ib2 = new inputbox("Hi there two");
ib3 = new inputbox("Hi there three");
// set some fonts
ib2.font = Font1;
ib3.font = Font2;
// set some cosmetic variables
ib2.lcase = true;
ib3.ucase = true;
// set some connections to be able to switch between boxes using arrows
ib1.ib_prev = ib3;
ib1.ib_next = ib2;
ib2.ib_prev = ib1;
ib2.ib_next = ib3;
ib3.ib_prev = ib2;
ib3.ib_next = ib1;
// force focus the first one
ib1.focus();
/// DRAW GUI
ib1.draw(50, 50);
ib2.draw(50, 50+25);
ib3.draw(50, 50+50);
or
/// DRAW
ib1.draw(50, 50, false); // set variable "gui" to false to use regular mouse instead of gui mouse
ib2.draw(50, 50+25, false);
ib3.draw(50, 50+50, false);