Skip to main content
History: MQuickGUI
View published page
Source of version: 3
(current)
{img src="img/wiki_up/QuickGUI_Logo.png" alt="QuickGUI_Logo.png" imalign="right"} {maketoc} !!About MQuickGUI is a ((-GUI)) system for ((MOGRE|Mogre)). It's a port of an older version of ((QuickGUI)) (0.9.5v2). The current version is working but still needs some adjustment. Please report Bugs & Feature's Request in the [http://www.ogre3d.org/addonforums/viewforum.php?f=8|MOGRE Add-On forum]. __Note: It's outdated!__ The last update was in 2007. If somebody wants to use it, the code have to be updated. (please give us the updated code) !!Featured widgets * Button * CheckBox * ComboBox * Console * Image * Label * LabelArea * List * LabelMenu * NStateButton * Panel * ProgressBar * Sheet * TextBox * Vertical/Horizontal TrackBar * Vertical/Horizontal ScrollBar * Window (with TitleBar) !!Download The source code can be found here: [http://mogre.svn.sourceforge.net/viewvc/mogre/trunk/MQuickGUI] !!Setup First of all, notice that the current MQuickGUI version still uses materials. In QuickGUI version 0.9.6 this has been changed. To set up a -GUI you have add a set of skin images to your resources. The images itself can be found in the zipped file of the ((QuickGUI|C++ version)) located in the folder ''bin/media/skins/qgui/''. In your resources.cfg you have to tell Ogre to load the skin. Add a line like that (the path has to be adjusted to your resources-folder!). {MONO()}FileSystem=C:/OgreSDK/media/skins/qgui{MONO} To get Ogre to find the images like "qgui.window" you have to add a file named "qgui.material" to your qgui-skins folder. This file describes the images you want to use. When initializing your resource groups it will also be loaded. __Important note:__ The following code part only covers the controls Window and Button! To use the other controls like combobox etc. you need to add their descriptions to the qgui.material file. It's just copy & paste with changing names. ''TODO: This code part should be made complete and downloadable.'' {CODE(wrap="1", colors="c++")}material qgui.pointer { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.pointer.png } } } } material qgui.panel { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.panel.png } } } } material qgui.window { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.window.png } } } } material qgui.window.titlebar { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.window.titlebar.png } } } } material qgui.window.titlebar.button { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.window.titlebar.button.png } } } } material qgui.window.titlebar.button.down { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.window.titlebar.button.down.png } } } } material qgui.window.titlebar.button.over { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.window.titlebar.button.over.png } } } } material qgui.window.border.bottom { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.window.border.bottom.png } } } } material qgui.window.border.left { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.window.border.left.png } } } } material qgui.window.border.right { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.window.border.right.png } } } } material qgui.window.border.top { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.window.border.top.png } } } } material qgui.button { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.button.png } } } } material qgui.button.disabled { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.button.disabled.png } } } } material qgui.button.down { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.button.down.png } } } } material qgui.button.over { technique { pass { lighting off ambient 1 1 1 diffuse 1 1 1 specular 1 1 1 30 scene_blend alpha_blend texture_unit { texture qgui.button.over.png } } } } {CODE} !!Usage This example code shows how to set up a small GUI: {CODE(wrap="1", colors="c#")}// Setup MQuickGUI.GUIManager.Singleton._notifyWindowDimensions(800, 600); // Better update this to your current viewport's size! MQuickGUI.GUIManager.Singleton.createMouseCursor(new Vector2(32, 32), "qgui.pointer"); // Create sheet and some widgets MQuickGUI.Sheet sh = MQuickGUI.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"); MQuickGUI.GUIManager.Singleton.setActiveSheet(sh);{CODE} Simple input handling with ((MOIS)): {CODE(wrap="1", colors="c#")}// Do this in OnFrameStarted(): // If mouse does not move in the whole window (cursor moves only for a few pixels), add this code berofe injectTime() method: // mouseState.width = 800; // window Width // mouseState.height = 600; // window Height MQuickGUI.GUIManager.Singleton.injectTime(evt.timeSinceLastFrame); // Do this in your mouse handling method: MQuickGUI.GUIManager.Singleton.injectMousePosition(mouseState.X.abs, mouseState.Y.abs) // Mouse cursor movement. MQuickGUI.GUIManager.Singleton.injectMouseButtonDown(MOIS.MouseButtonID.MB_Left); // Do this when MOIS says left mouse button is down. MQuickGUI.GUIManager.Singleton.injectMouseButtonUp(MOIS.MouseButtonID.MB_Left); // Do this when MOIS says left mouse button is up. // At the moment, keys have to be injected with their character into the GUI. The injectKeyCode() function isn't working. MQuickGUI.GUIManager.Singleton.injectChar('a');{CODE} It is imperative to properly clean up the -GUI when shutting down, otherwise you will get lots of AccessViolationExceptions when disposing. The cleanup has to be done in the same thread that created the GUI. {CODE(wrap="1", colors="c#")}// Clean up MQuickGUI.GUIManager.Singleton.destroySheet(sh);{CODE} !!See also * __((Comparison of GUIs))__ * ((QuickGUI)) (the original C++ project) * [http://www.ogre3d.org/wiki/index.php/Category:QuickGUI|Category:QuickGUI] (tutorials etc.) * ((MogreBetaGUI)) (another -GUI system for Mogre) * ((Mogre CEGUI)) (another -GUI system for Mogre) * ((Miyagi)) (another -GUI system for Mogre) * [http://www.ogre3d.org/phpBB2addons/viewtopic.php?p=36826#36826|Overlays] (the basic 2D elements in Ogre)
Search by Tags
Search Wiki by Freetags
Latest Changes
Compiled API Reference
Overlay Editor
Introduction - JaJDoo Shader Guide - Basics
RT Shader System
RapidXML Dotscene Loader
One Function Ogre
One Function Ogre
...more
Search
Find
Online Users
229 online users
OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username
Password
CapsLock is on.
Remember me (for 1 year)
Log in