problem with MQuickGui


09-02-2008 12:30:39

The library throws an exception in the next code:

mSheet = mGUIManager.createSheet("sheetGeneral");

THe Exception is :

System.InvalidCastException: Unable to cast object of type 'Mogre.PanelOverlayElement' to type 'Mogre.OverlayContainer'.
at MQuickGUI.Widget.createOverlayContainer(String name, String material)
at MQuickGUI.Widget..ctor(String instanceName, Vector4 dimensions, QGuiMetricsMode positionMode, QGuiMetricsMode sizeMode, String WidgetMaterial, OverlayContainer overlayContainer, Widget ParentWidget)
at MQuickGUI.Panel..ctor(String name, Vector4 dimensions, QGuiMetricsMode positionMode, QGuiMetricsMode sizeMode, String material, OverlayContainer overlayContainer, Widget parentWidget)
at MQuickGUI.Sheet..ctor(String name, String material)
at MQuickGUI.GUIManager._createSheet(String name, String material)
at MQuickGUI.GUIManager.createSheet(String name)
at CartaMayorClienteOgre3D.GUICartaMayorOgre.CreacionGUI()

it's very rare because i had the same code in other poject and it works perfectly.

Some help?



10-02-2008 18:22:16

Uhhmm.. strange..

Are you using the same SceneManager?
Are you initialising the MQuickGUI Manager?


10-02-2008 19:33:07


I re-compile the library MQuickGui, link the references again, and now all work fine.

Too strange.


13-02-2008 09:55:32

Hi, I have a problem with this subject too. But I don't manage to fix it. I follow the tutorial in wiki page about MquickGUI, and I put the same code:

GUIManager.Singleton._notifyWindowDimensions(800, 600); // Better update this to your current viewport's size!
GUIManager.Singleton.createMouseCursor(new Vector2(10, 10), "qgui.pointer");
Sheet sh = GUIManager.Singleton.createSheet("main sheet", "");
MQuickGUI.Window win = sh.createWindow("main window", new Vector4(50, 50, 400, 200), "qgui.window", MQuickGUI.QGuiMetricsMode.QGUI_GMM_PIXELS, MQuickGUI.QGuiMetricsMode.QGUI_GMM_PIXELS);
win.setText("window title");
MQuickGUI.Button bt = win.createButton("test button", new Vector4(50, 50, 100, 30), MQuickGUI.QGuiMetricsMode.QGUI_GMM_PIXELS, MQuickGUI.QGuiMetricsMode.QGUI_GMM_PIXELS, "qgui.button");
bt.setText("click me");


When I debugg it I have no problem, and I have no exception but it doesn't appear any MquickGUI in my aplication. Does anybody know which can be the problem or the mistake??Thanks


13-02-2008 12:41:38

Really I had no problem. The MQuickGUI was drawn but I couldn't see it because I had my overlays invisibles.