25 lines
939 B
Python
25 lines
939 B
Python
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)
|
|
if info["delta"] == "click":
|
|
if info["click"]:
|
|
print(info["cursor"]["poscale"])
|
|
# 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()
|