You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to select second screen or system primary screen when running this script. I was testing on a laptop with an external monitor on a linux machine (kubuntu). I had the second bigger screen set as my primary display, but it still picked up the laptop screen and was only tracking movement on that.
Any way to select screen or default to primary screen?
The text was updated successfully, but these errors were encountered:
That is the right resolution for the primary screen I am using. I think the issue is co-ordinates 0,0 is not in this screen but on the laptop as the laptop is left to my monitor.
I cloned the code and hacked around. It is getting the right co-ordinates with respect to the screen like (4152, 249), but that co-ordinate is beyond the bg.surface which is set to 2560 and 1080. I wrote a hacky solution to make it work
w, h = screen.current_w, screen.current_h
+ self.width = w
self.window_surface = pg.display.set_mode((w, h), pg.RESIZABLE)
self.ui_manager = pg_gui.UIManager((w, h))
self.bg = pg.Surface((w, h))
@@ -110,12 +111,14 @@ class Karbon:
pg.display.update()
def on_click(self, x, y, button, pressed):
+ x = x - self.width
if button is button.left:
pg.draw.circle(self.bg, YELLOW, (x, y), 4)
elif button is button.right:
pg.draw.circle(self.bg, (128, 0, 128), (x, y), 6)
def on_move(self, x, y):
+ x = x - self.width
pg.draw.line(self.bg, LINE_COLOR, (x, y), (x, y), 1)
I feel like being able to control the monitor for tracking would be a cool addition to this script.
Is it possible to select second screen or system primary screen when running this script. I was testing on a laptop with an external monitor on a linux machine (kubuntu). I had the second bigger screen set as my primary display, but it still picked up the laptop screen and was only tracking movement on that.
Any way to select screen or default to primary screen?
The text was updated successfully, but these errors were encountered: