ttfGetTextPosition function ttf

bool ttfGetTextPosition(
  1. Pointer<TtfText> text,
  2. Pointer<Int32> x,
  3. Pointer<Int32> y
)

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)

Implementation

bool ttfGetTextPosition(
  Pointer<TtfText> text,
  Pointer<Int32> x,
  Pointer<Int32> y,
) {
  final ttfGetTextPositionLookupFunction = _libTtf
      .lookupFunction<
        Uint8 Function(
          Pointer<TtfText> text,
          Pointer<Int32> x,
          Pointer<Int32> y,
        ),
        int Function(Pointer<TtfText> text, Pointer<Int32> x, Pointer<Int32> y)
      >('TTF_GetTextPosition');
  return ttfGetTextPositionLookupFunction(text, x, y) == 1;
}