Skip to content

Commit 6bd294b

Browse files
committed
Add binding for DrawTool::drawText
1 parent f35409f commit 6bd294b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_VisualParams.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ void moduleAddVisualParams(py::module &m)
9191
{
9292
self->draw3DText(point, size, sofa::type::RGBAColor::white(), text.c_str());
9393
});
94+
95+
dt.def("drawText", [](DrawTool* self, int x, int y, int fontSize, char* text){
96+
self->writeOverlayText(x,y, fontSize, sofa::type::RGBAColor::white(), text);
97+
});
9498
}
9599

96100
} /// namespace sofapython3

examples/example-drawing-controller.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def draw(self, visual_context):
2020
dt.drawPoints(self.target.position, 2.0)
2121

2222
dt.draw3DText(SofaTypes.Vec3d(-2.0,0.0,0.0), 0.5, "This is not a raptor")
23+
dt.drawText(10,10, 12, "Overlay text")
2324

2425
dt.drawFrames(self.mo.position, SofaTypes.Vec3d(0.1,0.1,0.1))
2526

0 commit comments

Comments
 (0)