Skip to content

Commit a177077

Browse files
author
Roberto De Ioris
committed
allow to pecify text size in draw_text
1 parent d309d05 commit a177077

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Source/UnrealEnginePython/Private/Slate/UEPyFPaintContext.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ static PyObject *py_ue_fpaint_context_draw_box(ue_PyFPaintContext *self, PyObjec
8989
static PyObject *py_ue_fpaint_context_draw_text(ue_PyFPaintContext *self, PyObject * args) {
9090
float x, y;
9191
char *text;
92+
float size = 0;
9293
PyObject *py_linear_color = nullptr;
9394
PyObject *py_font = nullptr;
9495

95-
if (!PyArg_ParseTuple(args, "(ff)s|OO:draw_text", &x, &y, &text, &py_linear_color, &py_font))
96+
if (!PyArg_ParseTuple(args, "(ff)s|fOO:draw_text", &x, &y, &text, &size, &py_linear_color, &py_font))
9697
return nullptr;
9798

9899
FLinearColor tint = FLinearColor::White;
@@ -116,6 +117,10 @@ static PyObject *py_ue_fpaint_context_draw_text(ue_PyFPaintContext *self, PyObje
116117
return PyErr_Format(PyExc_Exception, "argument is not a SlateFontInfo USTRUCT");
117118
}
118119
}
120+
if (size <= 0)
121+
size = font.Size;
122+
123+
font.Size = size;
119124

120125
FVector2D position = FVector2D(x, y);
121126

0 commit comments

Comments
 (0)