Add missing DrawText binding

This commit is contained in:
Magnus Norddahl 2022-07-23 18:21:04 +02:00 committed by Christoph Oelckers
parent 4f0b02b396
commit 0049fea8d6
2 changed files with 18 additions and 1 deletions

View file

@ -436,3 +436,21 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawText)
return 0;
}
DEFINE_ACTION_FUNCTION(FCanvas, DrawText)
{
PARAM_SELF_PROLOGUE(FCanvas);
PARAM_POINTER_NOT_NULL(font, FFont);
PARAM_INT(cr);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
PARAM_STRING(chr);
PARAM_VA_POINTER(va_reginfo) // Get the hidden type information array
VMVa_List args = { param + 5, 0, numparam - 6, va_reginfo + 5 };
const char *txt = chr[0] == '$' ? GStrings(&chr[1]) : chr.GetChars();
DrawText(self->Drawer.get(), font, cr, x, y, txt, args);
return 0;
}

View file

@ -519,7 +519,6 @@ class Canvas : Object native
native void SetClipRect(int x, int y, int w, int h);
native void ClearClipRect();
native int, int, int, int GetClipRect();
native int, int, int, int GetViewWindow();
native double, double, double, double GetFullscreenRect(double vwidth, double vheight, int fsmode);
native Vector2 SetOffset(double x, double y);
native void ClearScreen(color col = 0);