History: Miyagi
Source of version: 13
Copy to clipboard
{img src="img/wiki_up/Migari-GUI.jpg" alt="thumb|overview of controls" width="350" imalign="right"}
Miyagi stands for: ''Miyagi Is Yet Another Graphical user Interface''
It can only be used by ((MOGRE)) (.NET), not by Ogre itself (C++) code.
{img src="img/wiki_up/Forum_icon_question2.gif" alt="Forum icon question2.gif"} For bug reports or feature requests please use this [http://sourceforge.net/apps/trac/miyagi/|bug tracker].
---
__Download__:
[http://sourceforge.net/projects/miyagi/|Miyagi 1.2.0] (code, binary, sample application)
The __documentation__ is in the ''Help'' directory.
Plus there is a sample with source code.
%%%
!Controls
* Button
* CheckBox
* ComboBox
* DialogBox
* DropDownList
* Expander
* FlowLayoutPanel
* Label
* ListBox
* Panel
* PictureBox
* ProgressBar (horizontal and vertical)
* RadioButton
* RenderBox
* Slider (horizontal and vertical)
* TabControl
* TableLayoutPanel
* TextBox
!Additional features
* Import from / export to {LEX()}XML{LEX} file
* 3D Gui
* Scripting via Boo, C#, JScript, Lua, Nemerle, IronPython and VB.Net
%%%
!Code snippets
!!Miyagi and MOIS
Miyagi currently relies on ((MOIS)) for mouse and keyboard input.
You have to create a Mois.Mouse and Mois.Keyboard (that's done by the 'CreateInput' method in the sample).
And then either supply them as a parameter in 'GuiManager.Singleton.Initialize'
e.g.:
{CODE(wrap="1", colors="c#")}GuiManager.Singleton.Initialize(1024, 768, MySceneManager, MyCamera, MyMouse, MyKeyboard, true);{CODE}
or set ''GuiManager.Singleton.Mouse'' / ''GuiManager.Singleton.Keyboard'' directly.
And you have to capture the devices in your program's main loop (for instance in the 'FrameStarted' event handler).
{CODE(wrap="1", colors="c#")}MyKeyboard.Capture();
MyMouse.Capture(); {CODE}
%%%
__MOIS note 2__
After creating ''Mois.Mouse'' set this:
{CODE(wrap="1", colors="c#")}MOIS.MouseState_NativePtr state = mouse.MouseState;
state.width = (int)renderWindow.Width;
state.height = (int)renderWindow.Height;
{CODE}
%%%
!!Mouse visibility and debugging
Problem:
While debugging in Visual Studio (after an exception) the mouse pointer is not visible.
Solution:
Set ((MOIS)) to non-exclusive mode when application was started in Debug mode.
{CODE(wrap="1", colors="c#")}MOIS.ParamList pl = new MOIS.ParamList();
IntPtr windowHnd;
this.window.GetCustomAttribute("WINDOW", out windowHnd);
pl.Insert("WINDOW", windowHnd.ToString());
#if DEBUG
pl.Insert("w32_mouse", "DISCL_NONEXCLUSIVE");
pl.Insert("w32_mouse", "DISCL_FOREGROUND");
#endif
this.inputManager = MOIS.InputManager.CreateInputSystem(pl);
{CODE}
%%%
---
Note of user Beauty:
Add more snippets, starting from this forum post.
http://www.ogre3d.org/addonforums/viewtopic.php?f=8&t=9025&start=30
%%%
!See also
__Miyagi related:__
* ((Miyagi SetMousePosition|SetMousePosition)) - Miyagi code snippet to set mouse position on given coordinates (until embedded on main code)
__Common:__
* ((-GUI|GUI)) - an overview of GUI systems
* ((Mogre MyGUI wrapper)) - use ((MyGUI)) in Mogre
* ((Hikari Wrapper for MOGRE)) - embed Adobe Flash into Mogre (e.g. GUI menus)
* ((MogreBetaGUI))
* ((Easy Debug Text for MOGRE)) - for plain text display
* ((Prototype steps of GUI development))
* ((MQuickGUI)) - an outdated C# port of ((QuickGUI))