Created
September 4, 2022 22:41
Revisions
-
tshirtman created this gist
Sep 4, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ from kivy.app import App from kivy.factory import Factory as F from kivy.core.window import Window as W class CrossHairCursorApp(App): def build(self): root = F.Widget() with root.canvas.after: self.v_line = F.Line(points=[]) self.h_line = F.Line(points=[]) W.bind(mouse_pos=self.update_cursor) return root def update_cursor(self, window, mouse_pos): self.v_line.points = [mouse_pos[0], 0, mouse_pos[0], window.height] self.h_line.points = [0, mouse_pos[1], window.width, mouse_pos[1]] if __name__ == '__main__': CrossHairCursorApp().run()