Releases: ShashkovS/drawzero
Releases · ShashkovS/drawzero
Gradients, Points, Exceptions, etc
Ellipse, arc, rotated rectangle, text alignmetn and new examples
New features:
- Rotated rectangles:
filled_rect_rotated('red', (350, 350), 50, 100, 135)
rect_rotated('green', (350, 350), 50, 100, 45)
- Ellipse and arc
ellipse('grey', (100, 650), 200, 100)
arc('grey', (300, 650), 200, 100, start_angle=45, stop_angle=270)
arc('red', (350, 650), 100, 100, start_angle=45, stop_angle=270)
- Text alignment
text(C.magenta, 'text', (200, 900), 48, '>v')
text(C.red, '×', (200, 900), 72, '..')
text(C.magenta, 'align', (200, 900), 48, '<^')
Transparency + keyboard/mouse events
New features:
- Transparency is also straightforward via alpha or RGBA:
filled_circle('blue', (100, 110), 22, alpha=100)
polygon((0, 0, 255, 200), [(20, 300), (100, 340), (40, 260)], line_width=15)
- Keyboard and mouse events
Process keyboard events in two ways: check if key is pressed viaget_keys_pressed()
or run throwkeysdown
orkeysup
events
# Mouse buttons events
if mousebuttonsdown:
x, y = mousebuttonsdown[0].pos
# Keys which are still pressed
keys = get_keys_pressed()
if keys[K.UP] or keys[K.w]:
y -= 5
# Keyboard events
for ev in keysdown:
if ev.unicode:
upper_text += ev.unicode