Check for hovering a row of a table.
Check for hovering a row of a table.
How to check whether a row of a table (IGUITable class) is hovered? I can not find any suitable method in that class for doing that.
Re: Check for hovering a row of a table.
Yeah, doesn't have a function for that yet. Would need something like listbox has with getItemAt.
Internally it uses:
Selected = ((ypos - AbsoluteRect.UpperLeftCorner.Y - ItemHeight - 1) + VerticalScrollBar->getPos()) / ItemHeight;
I think you can access all those values, so as workaround you can calculate it like this.
Internally it uses:
Selected = ((ypos - AbsoluteRect.UpperLeftCorner.Y - ItemHeight - 1) + VerticalScrollBar->getPos()) / ItemHeight;
I think you can access all those values, so as workaround you can calculate it like this.
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
Re: Check for hovering a row of a table.
I seem to know how it may be implemented. It is derived enough easily. The steps are following:
- 1. Check whether an user is currently hovering a table element at all (getHovered()).
2. Get current position of the mouse cursor (getPosition()).
3. Run all table rows and get its core::vector2d (I`m not sure if there is a way to get it).
4. Check whether the cursor position is inside the rectangle (isPointInside()).
5. If isPointInside returns true, it means the row is hovered!