getSubStringForPoint method

TtfxSubString? getSubStringForPoint(
  1. int x,
  2. int y
)

Get the portion of a text string that is closest to a point.

This will return the closest substring of text to the given point.

\param text the TTF_Text to query. \param x the x coordinate relative to the left side of the text, may be outside the bounds of the text area. \param y the y coordinate relative to the top side of the text, may be outside the bounds of the text area. \param substring a pointer filled in with the closest substring of text to the given point. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function should be called on the thread that created the text.

\since This function is available since SDL_ttf 3.0.0.

extern SDL_DECLSPEC bool SDLCALL TTF_GetTextSubStringForPoint(TTF_Text *text, int x, int y, TTF_SubString *substring)

Implementation

TtfxSubString? getSubStringForPoint(int x, int y) =>
    ttfxGetTextSubStringForPoint(this, x, y);