1+ #include " UnrealEnginePythonPrivatePCH.h"
2+ #include " Runtime/Engine/Classes/GameFramework/HUD.h"
3+
4+ PyObject *py_ue_hud_draw_2d_line (ue_PyUObject *self, PyObject * args) {
5+
6+ ue_py_check (self);
7+
8+ int x1, y1, x2, y2;
9+ PyObject *py_fcolor;
10+
11+ if (!PyArg_ParseTuple (args, " iiiiO:hud_draw_2d_line" , &x1, &y1, &x2, &y2, &py_fcolor)) {
12+ return nullptr ;
13+ }
14+
15+ AHUD *hud = ue_py_check_type<AHUD >(self);
16+ if (!hud)
17+ return PyErr_Format (PyExc_Exception, " UObject is not a AHUD." );
18+
19+ ue_PyFColor *fcolor = py_ue_is_fcolor (py_fcolor);
20+ if (!fcolor)
21+ return PyErr_Format (PyExc_Exception, " argument is not a FColor." );
22+
23+ hud->Draw2DLine (x1, y1, x2, y2, fcolor->color );
24+
25+ Py_RETURN_NONE;
26+ }
27+
28+ PyObject *py_ue_hud_draw_line (ue_PyUObject *self, PyObject * args) {
29+
30+ ue_py_check (self);
31+
32+ float x1, y1, x2, y2;
33+ PyObject *py_fcolor;
34+ float thickness;
35+
36+ if (!PyArg_ParseTuple (args, " ffffOf:hud_draw_line" , &x1, &y1, &x2, &y2, &py_fcolor, &thickness)) {
37+ return nullptr ;
38+ }
39+
40+ AHUD *hud = ue_py_check_type<AHUD >(self);
41+ if (!hud)
42+ return PyErr_Format (PyExc_Exception, " UObject is not a AHUD." );
43+
44+ ue_PyFColor *fcolor = py_ue_is_fcolor (py_fcolor);
45+ if (!fcolor)
46+ return PyErr_Format (PyExc_Exception, " argument is not a FColor." );
47+
48+ hud->DrawLine (x1, y1, x2, y2, fcolor->color , thickness);
49+
50+ Py_RETURN_NONE;
51+ }
52+
53+ PyObject *py_ue_hud_draw_texture (ue_PyUObject *self, PyObject * args) {
54+
55+ ue_py_check (self);
56+
57+ PyObject *py_texture;
58+ float x, y, w, h;
59+ float u = 0 , v = 0 , uw = 1 , vh = 1 ;
60+ PyObject *py_flinear_color = nullptr ;
61+ int blend_mode = EBlendMode::BLEND_Translucent;
62+ float scale = 1 ;
63+ PyObject *py_scale_position = nullptr ;
64+ float rotation = 0 ;
65+ float pivot_rot_x = 0 , pivot_rot_y = 0 ;
66+
67+
68+ if (!PyArg_ParseTuple (args, " Offff|ffffOifOf(ff):hud_draw_texture" , &py_texture, &x, &y, &w, &h, &u, &v, &uw, &vh, &py_flinear_color, &blend_mode, &scale, &py_scale_position, &rotation, &pivot_rot_x, &pivot_rot_y)) {
69+ return nullptr ;
70+ }
71+
72+ AHUD *hud = ue_py_check_type<AHUD >(self);
73+ if (!hud)
74+ return PyErr_Format (PyExc_Exception, " UObject is not a AHUD." );
75+
76+ UTexture *texture = ue_py_check_type<UTexture>(py_texture);
77+ if (!texture)
78+ return PyErr_Format (PyExc_Exception, " argument is not a UTexture." );
79+
80+ FLinearColor tint = FLinearColor::White;
81+
82+ if (py_flinear_color) {
83+ ue_PyFLinearColor *flinear_color = py_ue_is_flinearcolor (py_flinear_color);
84+ if (!flinear_color)
85+ return PyErr_Format (PyExc_Exception, " argument is not a FLinearColor." );
86+ tint = flinear_color->color ;
87+ }
88+
89+ bool scale_position = false ;
90+ if (py_scale_position && PyObject_IsTrue (py_scale_position))
91+ scale_position = true ;
92+
93+ hud->DrawTexture (texture, x, y, w, h, u, v, uw, vh, tint, (EBlendMode)blend_mode, scale, scale_position, rotation, FVector2D (pivot_rot_x, pivot_rot_y));
94+
95+ Py_RETURN_NONE;
96+ }
0 commit comments