MCPcopy Create free account
hub / github.com/JacquesLucke/code_autocomplete / draw_text_on_rectangle

Function draw_text_on_rectangle

graphics.py:36–41  ·  view source on GitHub ↗
(text, rectangle, color = (0.2, 0.2, 0.2, 1.0), size = 20, align = "LEFT")

Source from the content-addressed store, hash-verified

34
35font_id = 1
36def draw_text_on_rectangle(text, rectangle, color = (0.2, 0.2, 0.2, 1.0), size = 20, align = "LEFT"):
37 position = (rectangle.left, rectangle.bottom + rectangle.height / 3)
38 if align == "CENTER":
39 center = rectangle.center
40 position = (center[0], rectangle.bottom + rectangle.height / 3)
41 draw_text(text, position, size = size, horizontal_align = align, vertical_align = "BOTTOM")
42
43def draw_text(text = "", position = (0, 0), size = 200, horizontal_align = "LEFT", vertical_align = "BOTTOM", color = (0.2, 0.2, 0.2, 1.0), font_id = font_id):
44

Callers

nothing calls this directly

Calls 1

draw_textFunction · 0.85

Tested by

no test coverage detected