TextSceneNode and getSceneNodeFromScreenCoordinatesBB

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
spod
Posts: 1
Joined: Mon Mar 20, 2017 11:50 am

TextSceneNode and getSceneNodeFromScreenCoordinatesBB

Post 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...
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: TextSceneNode and getSceneNodeFromScreenCoordinatesBB

Post 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.
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
Post Reply