Calling into the current active canvas - howto?
by Thomas \"Man of Ice\" Lund · in Torque Game Engine · 03/11/2006 (3:38 pm) · 2 replies
What I'm trying to do is having a C++ method call a onReceiveMessage() script method.
Thats a nobrainer with Con::executef()
But what I really want is for each GUI to have its own onReceiveMessage() in its namespace.
E.g. PlayGui::onReceiveMessage(), MainMenu::onReceiveMessage()
I've tried to search around, but I simply cannot find an example of how to do a "Canvas.getContent()" from the engine.
Does anyone have a clue how to do this?
Thats a nobrainer with Con::executef()
But what I really want is for each GUI to have its own onReceiveMessage() in its namespace.
E.g. PlayGui::onReceiveMessage(), MainMenu::onReceiveMessage()
I've tried to search around, but I simply cannot find an example of how to do a "Canvas.getContent()" from the engine.
Does anyone have a clue how to do this?
#2
Just do this:
Then you can use executef for something along this line:
Which will call the onLoadBuddyData function into the namespace of the current active GUI
03/17/2006 (7:12 am)
If anyone ever searches for the same, then here is the info on how to do it. Its actually extremely simpleJust do this:
#include "gui/core/guiCanvas.h" GuiControl* currentGui = Canvas->getContentControl();
Then you can use executef for something along this line:
Con::executef(Canvas->getContentControl(), 5, "onLoadBuddyData", Con::getIntArg(result), Con::getIntArg(buddyId), nameBuf, Con::getIntArg(statusCode), addressBuffer);
Which will call the onLoadBuddyData function into the namespace of the current active GUI
Associate Manoel Neto
Default Studio Name