Page 1 of 1
TextSceneNode and getSceneNodeFromScreenCoordinatesBB
Posted: Mon Mar 20, 2017 11:53 am
by spod
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...
Re: TextSceneNode and getSceneNodeFromScreenCoordinatesBB
Posted: Mon Mar 20, 2017 1:01 pm
by CuteAlien
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:
Code: Select all
core::dimension2d<u32> font->getDimension(L"your_text");
core::position2d<s32> pos = collisionManager->getScreenCoordinatesFrom3DPosition(node->getAbsolutePosition(),
SceneManager->getActiveCamera());
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.