Incomplete improvement (Anchor object)

This commit is contained in:
2025-04-06 23:26:26 +08:00
parent 89c8b34550
commit 27d7ffe4bf
7 changed files with 81 additions and 11 deletions

View File

@@ -9,19 +9,21 @@ def horizontal_indicator():
vgl.elements.Line(ends=[(0.4, 0.5), (0.6, 0.5)], color="green").attach(frame_object=frame)
pass
@window.observerize
def observer(info):
if info["delta"] == "key":
print(info)
pass
def marking_lines():
global window
frame = vgl.Frame().attach(window_object=window, poscale=(0,0), clone_name="Marking Line")
lines = list()
for i in range(0, 24):
vgl.elements.Line(ends=[(0, i/24), (1, i/24)], color="green").attach(frame_object=frame)
lines.append(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)
lines.append(vgl.elements.Line(ends=[(i/32, 0), (i/32, 1)], color="green").attach(frame_object=frame))
@window.observerize
def observer(info):
if info["delta"] == "key":
print(info)
for i in lines:
i.set_color('#' + str((info['cursor']['position'][0] + info['cursor']['position'][1]*100 + info['cursor']['position'][0]*10000) % 999999).zfill(6))
observer()
def console():
print("You've entered Pulsar's command console, an embbedded Python interpreter for debugging & testing")
@@ -32,14 +34,13 @@ def console():
return
exec(i)
except:
print("An error caused & captured")
print("An error occured & captured")
if __name__ == '__main__':
print("Welcome to AiraPulsar Client")
window.start()
horizontal_indicator()
marking_lines()
observer()
console()
input("任意键以退出")
window.kill()