SFML community forums
Help => Window => Topic started by: Demian on April 18, 2010, 03:57:04 pm
-
Is it possible to code an text box with SFML or do I have to use the headers from the OS as windows.h ?
-
SFML doesn't include anything like that. Windows message box would work, but I would recommend using Qt for cross-platform goodness :)
There is also some sort of GUI thing in the wiki I believe, but I haven't looked into it.
EDIT: Come to think of it, you could just make a new window. Make your own buttons etc. Probably could even encase this in a class and have it return whatever based on which button was pressed, sort of like windows MessageBox. :wink:
-
You can handle the TextEntered event. For a fully functional hand made textbox it would require a bit more work to do the caret, text selection, focus handling, etc.
But depends on what you want to do with it
-
SFML doesn't include anything like that. Windows message box would work, but I would recommend using Qt for cross-platform goodness :)
There is also some sort of GUI thing in the wiki I believe, but I haven't looked into it.
EDIT: Come to think of it, you could just make a new window. Make your own buttons etc. Probably could even encase this in a class and have it return whatever based on which button was pressed, sort of like windows MessageBox. :wink:
I just want to add a textbox in order to take Input from the keyboard.
It should to be something like EDITTEXT from windows.h
-
Sorry, I completely misread. I thought you were after a message box type thing.
TextEntered is the closest thing to a text box that SFML has. Like gsaurus said, it depends what you need it to do.
I just looked in the wiki, cpGUI has a text box object, but like I said I haven't really checked it out yet.