logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Availability

       This function is available since SDL_ttf 3.0.0.

SDL_ttf                                           SDL_ttf 3.2.2                  TTF_GetTextSubStringForPoint(3)

Description

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

Function Parameters

text   the TTF_Text
               to query.

       x      the  x  coordinate  relative  to  the left side of the text, may be outside the bounds of the text
              area.

       y      the y coordinate relative to the top side of the text, may be outside the bounds of the text area.

       substring
              a pointer filled in with the closest substring of text to the given point.

Header File

       Defined in SDL3_ttf/SDL_ttf.h

Name

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

Return Value

       Returns true on success or false on failure; call SDL_GetError() for more information.

Synopsis

#include"SDL3_ttf/SDL_ttf.h"boolTTF_GetTextSubStringForPoint(TTF_Text*text,intx,inty,TTF_SubString*substring);

Thread Safety

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

See Also