Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Text box in SFML ?  (Read 5967 times)

0 Members and 1 Guest are viewing this topic.

Demian

  • Newbie
  • *
  • Posts: 16
    • View Profile
Text box in SFML ?
« 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 ?

Walker

  • Full Member
  • ***
  • Posts: 181
    • View Profile
Text box in SFML ?
« Reply #1 on: April 19, 2010, 07:35:48 am »
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:

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Text box in SFML ?
« Reply #2 on: April 19, 2010, 04:22:52 pm »
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
Pluma - Plug-in Management Framework

Demian

  • Newbie
  • *
  • Posts: 16
    • View Profile
Text box in SFML ?
« Reply #3 on: April 19, 2010, 05:50:35 pm »
Quote from: "Walker"
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

Walker

  • Full Member
  • ***
  • Posts: 181
    • View Profile
Text box in SFML ?
« Reply #4 on: April 20, 2010, 02:35:31 am »
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.

 

anything