You've already forked AiraPulsar
Add basic components support
This commit is contained in:
0
pulsar/components/__horizontal_indicator.py
Normal file
0
pulsar/components/__horizontal_indicator.py
Normal file
BIN
pulsar/components/__pycache__/marking_lines.cpython-312.pyc
Normal file
BIN
pulsar/components/__pycache__/marking_lines.cpython-312.pyc
Normal file
Binary file not shown.
21
pulsar/components/marking_lines.py
Normal file
21
pulsar/components/marking_lines.py
Normal 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()
|
Reference in New Issue
Block a user