Skip to content

Commit 8d86a2f

Browse files
committed
feat: more imgui bindings & some custom type testing
1 parent 250293c commit 8d86a2f

16 files changed

Lines changed: 5167 additions & 333 deletions

examples/example_basic_0.py

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,15 @@ def pl_app_update(self):
116116
fgLayer,
117117
[40.0, 40.0],
118118
[1240.0, 680.0],
119-
color=PL_COLOR_32_YELLOW,
120-
thickness=2.0
119+
plDrawLineOptions(PL_COLOR_32_YELLOW, 2.0)
121120
)
122121

123122
# Diagonal guide line
124123
pl_draw_add_line(
125124
fgLayer,
126125
[40.0, 40.0],
127126
[1240.0, 680.0],
128-
color=PL_COLOR_32_GREEN,
129-
thickness=2.0
127+
plDrawLineOptions(PL_COLOR_32_GREEN, 2.0)
130128
)
131129

132130
# Rounded panel region
@@ -137,8 +135,7 @@ def pl_app_update(self):
137135
16.0, # rounding radius
138136
0, # segment count (0 = automatic/default)
139137
plDrawRectFlag.PL_DRAW_RECT_FLAG_NONE,
140-
color=PL_COLOR_32_CYAN,
141-
thickness=2.0
138+
plDrawLineOptions(PL_COLOR_32_CYAN, 2.0)
142139
)
143140

144141
# Triangle outline
@@ -147,7 +144,7 @@ def pl_app_update(self):
147144
[120.0, 240.0],
148145
[240.0, 120.0],
149146
[320.0, 260.0],
150-
color=PL_COLOR_32_WHITE
147+
plDrawLineOptions(PL_COLOR_32_WHITE)
151148
)
152149

153150
# Arbitrary quad outline
@@ -157,7 +154,7 @@ def pl_app_update(self):
157154
[760.0, 120.0],
158155
[720.0, 260.0],
159156
[540.0, 220.0],
160-
color=PL_COLOR_32_ORANGE
157+
plDrawLineOptions(PL_COLOR_32_ORANGE)
161158
)
162159

163160
# Circle outline
@@ -166,7 +163,7 @@ def pl_app_update(self):
166163
[930.0, 180.0],
167164
70.0,
168165
0, # segment count (0 = automatic/default)
169-
color=PL_COLOR_32_BLUE
166+
plDrawLineOptions(PL_COLOR_32_BLUE)
170167
)
171168

172169
# Polygon outline
@@ -180,7 +177,7 @@ def pl_app_update(self):
180177
[1070.0, 260.0],
181178
[1010.0, 180.0],
182179
],
183-
color=PL_COLOR_32_RED
180+
plDrawLineOptions(PL_COLOR_32_RED)
184181
)
185182

186183
pl_draw_add_bezier_quad(
@@ -189,7 +186,7 @@ def pl_app_update(self):
189186
[260.0, 320.0], # control
190187
[420.0, 450.0], # end
191188
0, # segment count (0 = automatic/default)
192-
color=PL_COLOR_32_BLUE
189+
plDrawLineOptions(PL_COLOR_32_BLUE)
193190
)
194191

195192
# Cubic bezier with thicker line
@@ -200,41 +197,39 @@ def pl_app_update(self):
200197
[360.0, 660.0], # control 2
201198
[460.0, 540.0], # end
202199
0, # segment count
203-
color=PL_COLOR_32_RED,
204-
thickness=3.0
200+
plDrawLineOptions(PL_COLOR_32_RED, 3.0)
205201
)
206202

207203
# Filled triangle
208204
pl_draw_add_triangle_filled(
209205
fgLayer,
210206
[640.0, 420.0],
211207
[820.0, 360.0],
212-
[760.0, 560.0]
208+
[760.0, 560.0],
209+
plDrawSolidOptions(PL_COLOR_32_WHITE)
213210
)
214211

215212
# Filled-looking composition using multiple primitives
216213
pl_draw_add_line(
217214
fgLayer,
218215
[900.0, 360.0],
219216
[1180.0, 360.0],
220-
color=PL_COLOR_32_WHITE,
221-
thickness=4.0
217+
plDrawLineOptions(PL_COLOR_32_WHITE, 4.0)
222218
)
223219

224220
pl_draw_add_rect(
225221
fgLayer,
226222
[920.0, 390.0],
227223
[1160.0, 560.0],
228-
color=PL_COLOR_32_WHITE,
229-
thickness=3.0
224+
plDrawLineOptions(PL_COLOR_32_WHITE, 3.0)
230225
)
231226

232227
pl_draw_add_circle(
233228
fgLayer,
234229
[1040.0, 475.0],
235230
50.0,
236231
0,
237-
color=PL_COLOR_32_GREEN
232+
plDrawLineOptions(PL_COLOR_32_GREEN)
238233
)
239234

240235
# Submit/present the frame.

0 commit comments

Comments
 (0)