Add basic components support

This commit is contained in:
2025-04-08 23:14:29 +08:00
parent 27d7ffe4bf
commit fd67663868
9 changed files with 68 additions and 70 deletions

View File

@@ -0,0 +1,21 @@
import vgl
name = "Marking Lines"
def main(window):
frame = vgl.Frame().attach(window_object=window, poscale=(0,0), clone_name="Marking Line")
lines = list()
for i in range(0, 24):
lines.append(vgl.elements.Line(ends=[(0, i/24), (1, i/24)], color="green").attach(frame_object=frame))
for i in range(0, 32):
lines.append(vgl.elements.Line(ends=[(i/32, 0), (i/32, 1)], color="green").attach(frame_object=frame))
# We monitor events like this.
@window.observerize
def observer(info):
if info["delta"] == "key":
print(info)
# We make changes like this.
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()