TextEditor tf = FengGUI.createTextEditor(window.getContentContainer());
tf.setEmptyText("Enter Some Text Here...");
tf.setSize(200,26);
tf.addTextChangedListener(textListener);
it loads. but when i click the mouse inside the TextEditor i get this crash:
SEVERE: Main game loop broken by uncaught exception
org.lwjgl.opengl.OpenGLException: Invalid operation (1282)
at org.lwjgl.opengl.Util.checkGLError(Util.java:56)
at org.lwjgl.opengl.Display.swapBuffers(Display.java:555)
at org.lwjgl.opengl.Display.update(Display.java:571)
at com.jme.renderer.lwjgl.LWJGLRenderer.displayBackBuffer(Unknown Source)
at com.jmex.game.StandardGame.run(Unknown Source)
at java.lang.Thread.run(Thread.java:613)
l—l: i guess in your case, you didn't create the FengGUI-GameState in the OpenGL thread?
From the Wiki:
// Make sure the FengGUI GameState get created inside the OpenGL Thread.
try {
GameTaskQueueManager.getManager().render(new Callable<Object>() {
public Object call() throws Exception {
FengGUIGameState fengState = new FengGUIGameState();
correct. here is the full code that runs correctly for me.
is it me, or does fenggui have poor support for text box interaction? i.e. double clicking words to select, mouse drag to select, shift-arrows to select, option-arrow to skip forward and backward, holding down keys for repeat, etc. but i guess that's a post for the fenggui forum, not the jme forum :)
GameTaskQueueManager.getManager().update( new Callable<Object>() {
public Object call() throws Exception {
try{
TextEditor tf = FengGUI.createTextEditor(window.getContentContainer());
tf.setText( "Enter Some Text Here..." );
tf.setSize( 200, 26 );
tf.addTextChangedListener( new ITextChangedListener() {
public void textChanged( TextChangedEvent textChangedEvent ) {
System.out.println( "hello world" );
}
} );