Starfinder Playlist
  1. #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.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    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!

  3. #3
    That's unfortunate. Thank you for the reply

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in