mohamed.irshad.k Posted May 11, 2012 Share Posted May 11, 2012 When WidgetEditText is put inside a vbox and the WidgetEditText's text crosses the vbox's bottom boundary, the rendering of the text stops. Below is the complete code to reproduce the issue. Gui gui; WidgetVBox vbox; WidgetButton button; WidgetEditText text; int init() { gui = engine.getGui(); vbox = new WidgetVBox(gui); vbox.setBackground(1); vbox.setWidth( 300 ); vbox.setHeight( 200 ); gui.addChild(vbox,GUI_ALIGN_OVERLAP | GUI_ALIGN_CENTER); text = new WidgetEditText(gui, "WidgetEditText..." ); text.setPosition( 150, 0 ); vbox.addChild(text, GUI_ALIGN_OVERLAP | GUI_ALIGN_FIXED ); button = new WidgetButton(gui, "Drag Me" ); button.setCallback( GUI_PRESSED, "OnPressed" ); button.setCallback( GUI_RELEASED, "OnReleased" ); vbox.addChild(button, GUI_ALIGN_OVERLAP | GUI_ALIGN_FIXED); return 1; } void OnPressed() { text.setPosition( text.getPositionX() + gui.getMouseDX(), text.getPositionY() + gui.getMouseDY() ); } int nCount = 0; void OnReleased() { text.addLine( format( "%d", nCount ) ); nCount++; } int update() { return 1; } int shutdown() { return 1; } Link to comment
carl.sutton Posted May 11, 2012 Share Posted May 11, 2012 This may or may not be the reason but try running in DX9/11/OpenGL https://developer.unigine.com/forum/topic/1167-blank-editline-widgets/ Link to comment
ashwin.sudhir Posted May 11, 2012 Share Posted May 11, 2012 Thanks carl, but we are rendering on D3D9. Link to comment
Guest mrred Posted May 12, 2012 Share Posted May 12, 2012 Hi, Mohamed, we were able to reproduce this bug. Thank you for your report! Link to comment
unclebob Posted May 12, 2012 Share Posted May 12, 2012 Hi Mohamed, WidgetEditText has vertical string limit due performance issues (less draw calls). Try to add WidgetEditText as a second root to gui. Here is modified init function: int init() { gui = engine.getGui(); vbox = new WidgetVBox(gui); vbox.setBackground(1); vbox.setWidth( 300 ); vbox.setHeight( 200 ); gui.addChild(vbox,GUI_ALIGN_OVERLAP | GUI_ALIGN_FIXED | GUI_ALIGN_CENTER); text = new WidgetEditText(gui, "WidgetEditText..." ); text.setPosition( 150, 0 ); gui.addChild(text,GUI_ALIGN_OVERLAP | GUI_ALIGN_FIXED | GUI_ALIGN_CENTER); button = new WidgetButton(gui, "Drag Me" ); button.setCallback( GUI_PRESSED, "OnPressed" ); button.setCallback( GUI_RELEASED, "OnReleased" ); vbox.addChild(button, GUI_ALIGN_OVERLAP | GUI_ALIGN_FIXED); return 1; } Does it solves your problem? Link to comment
mohamed.irshad.k Posted May 14, 2012 Author Share Posted May 14, 2012 Thanks unclebob, Even with this approach the issue appears once the text crosses the app window's bottom boundary. If the WidgetEditText is put inside a WidgetScrollBox the text is rendered properly. Link to comment
unclebob Posted May 21, 2012 Share Posted May 21, 2012 Hello Mogamed, Sorry for late reply. Text limits for WidgetScrollBox is set by parent widget (we're using WidgetVBox as root container for GUI), so you can't change that. By the way, there are two solutions here: 1. You can use add WidgetScrollBox and hide it. 2. You can use WidgetLabel with rich text formatting enabled in it Link to comment
Recommended Posts