How can i create a large text edit box? I have found the multiline state but it puts the text halfway down and there are no scrollers :/
Is there a gui element to do this?
Large text boxes?
Yep, all you have to do is call "setMultiLine()" Like this:
Code: Select all
editbox->setMultiLine(true);setTextAlignment allows you to set the text alignment - vertical alignment is centered by default.
With setAutoScroll you can allow users to scroll around with cursor keys. Scrollbars are not part of IGUIEditbox but an own guielement. Also right now it's not possible to control scrolling in the editbox from outside.
If you need more advanced stuff you can also add your own guielement. Start for example by copying the sources of CGUIEditBox and then add whatever feature you need.
With setAutoScroll you can allow users to scroll around with cursor keys. Scrollbars are not part of IGUIEditbox but an own guielement. Also right now it's not possible to control scrolling in the editbox from outside.
If you need more advanced stuff you can also add your own guielement. Start for example by copying the sources of CGUIEditBox and then add whatever feature you need.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
I know this subject is over a year since last comment but I also wanted a quick and easy scratchpad inside my irrlicht toy. Here is an example I figured out from the api documentation and I thought I would share. It is really neat how text highlighting and Control-C(copy)/Control-V(paste) works in the scratchpad.
ignore me if I'm doing something stupid. I'm learning.
Code: Select all
void createScratchPad() //create a giant edit box to use as a scratch pad
{
IGUIWindow* ScratchPadWindow = Device->getGUIEnvironment()->addWindow(core::rect<s32>(23,40,325,342),false,L"Scratchpad");
IGUIEditBox* ScratchPadBox = Device->getGUIEnvironment()->addEditBox(L"", core::rect<s32>(0,20,300,300), true, ScratchPadWindow);
ScratchPadBox->setMultiLine(true);
ScratchPadBox->setWordWrap(true);
ScratchPadBox->setTextAlignment(EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
ScratchPadBox->setAutoScroll(true);
}
ignore me if I'm doing something stupid. I'm learning.