mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 00:03:45 +08:00
add simple usage example to window.py
old-commit-hash: c4592e854767e635e4e1f6a75e74f1453043c8c4
This commit is contained in:
@@ -38,3 +38,13 @@ class Window():
|
||||
if event.type == pygame.MOUSEBUTTONDOWN:
|
||||
mx, my = pygame.mouse.get_pos()
|
||||
return mx, my
|
||||
|
||||
if __name__ == "__main__":
|
||||
import numpy as np
|
||||
win = Window(200, 200)
|
||||
img = np.zeros((200,200,3), np.uint8)
|
||||
while 1:
|
||||
print("draw")
|
||||
img += 1
|
||||
win.draw(img)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user