You've already forked AiraPulsar
"锚定点" 功能更新
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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()
|
||||
|
BIN
pulsar/components/__pycache__/marker.cpython-312.pyc
Normal file
BIN
pulsar/components/__pycache__/marker.cpython-312.pyc
Normal file
Binary file not shown.
@@ -15,6 +15,9 @@ def main(window):
|
||||
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))
|
Reference in New Issue
Block a user