-
October 9th, 2023, 10:50 #1
formattedtextcontrol getIndexAt() ?
Hello! I'd like to be able to get the text under the cursor using the getIndexAt function that the 5E ruleset uses for highlighting NPC action clauses when hovered over.
The problem is that I am using a formatted text control, as its necessary to get the formatting I need, but it seems that since the formattedtextcontrol doesn't inherit from textbasecontrol, it doesn't have the getIndexAt function. Is there any way to replicate or recreate the functionality of getting the character index at a given x, y position in a formattedtextcontrol?
Code:function onHoverUpdate(x, y) local nMouseIndex = getIndexAt(x, y); // works with any textbasecontrol but not with a formattedtextcontrol end
Last edited by GEONE; October 9th, 2023 at 10:56.
-
October 9th, 2023, 11:15 #2
I don't know of a way to do this currently in a formatted text control, the published API doesn't support it.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
October 9th, 2023, 11:37 #3
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks