minor VGL improvements

This commit is contained in:
2025-04-05 14:21:31 +08:00
parent bce75a1727
commit 890543e3c1
6 changed files with 185 additions and 8 deletions

View File

@@ -3,23 +3,33 @@ import time
window = None
def horizontal_indicator():
global window
frame = vgl.Frame().attach(window, (0, 0), "Horizontal Indicator")
vgl.elements.Line(ends=[(0.4, 0.5), (0.6, 0.5)], color="green").attach(frame)
frame = vgl.Frame().attach(window_object=window, poscale=(0, 0), clone_name="Horizontal Indicator")
vgl.elements.Line(ends=[(0.4, 0.5), (0.6, 0.5)], color="green").attach(frame_object=frame)
pass
def marking_lines():
global window
frame = vgl.Frame().attach(window_object=window, poscale=(0,0), clone_name="Marking Line")
for i in range(0, 24):
vgl.elements.Line(ends=[(0, i/24), (1, i/24)], color="green").attach(frame_object=frame)
for i in range(0, 32):
vgl.elements.Line(ends=[(i/32, 0), (i/32, 1)], color="green").attach(frame_object=frame)
def console():
print("You've entered Pulsar's command console, an embbedded Python interpreter for debugging & testing")
while True:
try:
exec(input(">>> "))
exec(input(prompt=">>> "))
except:
print("An error caused & captured")
if __name__ == '__main__':
print("Welcome to AiraPulsar Client")
window = vgl.Window(title="Pulsar", size=(1600, 800))
window = vgl.Window(title="Pulsar", size=(1024, 768))
window.start()
horizontal_indicator()
marking_lines()
#console()
time.sleep(3)
input("任意键以退出")
window.kill()
exit()