ttfxGetTextPosition function ttf
Get the position of a text object.
\param text the TTF_Text to query. \param x a pointer filled in with the x offset of the upper left corner of this text in pixels, may be NULL. \param y a pointer filled in with the y offset of the upper left corner of this text in pixels, may be NULL. \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.
\sa TTF_SetTextPosition
extern SDL_DECLSPEC bool SDLCALL TTF_GetTextPosition(TTF_Text *text, int *x, int *y)
See also:
Implementation
SdlxPoint? ttfxGetTextPosition(Pointer<TtfText> text) => ffi.using((arena) {
final xPointer = arena<Int32>();
final yPointer = arena<Int32>();
final success = ttfGetTextPosition(text, xPointer, yPointer);
if (!success) {
return null;
}
return SdlxPoint(xPointer.value, yPointer.value);
});