Hi, I am trying to detect mouse click on TextSceneNode but it is never returned, what am I doing wrong, call is simple but it just doesnt return ISceneNode* matching the screen coordinates for TextSceneNode... Is it a problem as it is 2d?
Thank you...
TextSceneNode and getSceneNodeFromScreenCoordinatesBB
Re: TextSceneNode and getSceneNodeFromScreenCoordinatesBB
Yeah, that seems to be the problem. But in that case you can probably do a test with 2d mouse coordinates.
The position of the text should be:
If you are using Irrlicht svn trunk version, I've just added some functions there to get the text and the font of the textscenenode (those were missing for some reason...). Otherwise I suppose you have to buffer those outside.
The position of the text should be:
Code: Select all
core::dimension2d<u32> font->getDimension(L"your_text");
core::position2d<s32> pos = collisionManager->getScreenCoordinatesFrom3DPosition(node->getAbsolutePosition(),
SceneManager->getActiveCamera());
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm