Upgrading from MyGUI 2. to 3.

Ripgiblet

26-05-2010 10:05:38

Ok I just wanted to start a forum topic to help other people that are probably having the same problems as me upgrading from MyGUI 2 to MyGUI 3...
This info is from MyGUI 2.2 to MyGUI 3.01. Also note that this is a work in progress, so please tell me when I am doing something wrong, a better way etc...

Some of the many changes required...(mGuiMgr is the MyGUI::Gui*)
1)FROM
mGuiMgr->injectMouseMove(arg)
TO
mGuiMgr->injectMouseMove(arg.state.X.abs,arg.state.Y.abs,arg.state.Z.abs)

2)FROM
mGuiMgr->injectMousePress(arg,id)
TO
mGuiMgr->injectMousePress(arg.state.X.abs,arg.state.Y.abs,MyGUI::MouseButton::Enum(id))


3)FROM
mGuiMgr->injectMouseRelease(arg,id)
TO
mGuiMgr->injectMouseRelease(arg.state.X.abs,arg.state.Y.abs,MyGUI::MouseButton::Enum(id));

4)FROM
mGuiMgr->injectKeyRelease(arg)
TO
MyGUI::Char text = (MyGUI::Char)_arg.text;
MyGUI::KeyCode key = MyGUI::KeyCode::Enum(_arg.key);
int scan_code = key.toValue();

if (scan_code > 70 && scan_code < 84)
{
static MyGUI::Char nums[13] = { 55, 56, 57, 45, 52, 53, 54, 43, 49, 50, 51, 48, 46 };
text = nums[scan_code-71];
}
else if (key == MyGUI::KeyCode::Divide)
{
text = '/';
}
else
{
#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
text = translateWin32Text(key);
#endif
}

//Lets let the GUI handle if a key is pressed.
if (mGuiMgr) mGuiMgr->injectKeyPress(key,text);

5)FROM
new MyGUI::ControllerPosition(_point, time_anim, MyGUI::newDelegate(MyGUI::action::jumpMoveFunction<5>))
TO
MyGUI::ControllerPosition* vConPos = new MyGUI::ControllerPosition();
vConPos->setPosition(_point);
vConPos->setTime(time_anim);
vConPos->setAction(MyGUI::newDelegate(MyGUI::action::jumpMoveFunction<5>));

Anyway just wanted to get this topic started, since it is taking a long time to upgrade my project... I am also having problems with finding resources... assuming they have abstracted Ogres resource management somehow and I have not linked it...

Anyway hope this info might help somebody... I will consolidate it at a later date... :mrgreen: