Is there a way to get the device's screen resolution with Kivy, so I can assign it to a variable? I have been using PyAutoGUI for that purpose, but would much rather do it with Kivy, if possible.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
https://kivy.org/docs/api-kivy.core.window.html#kivy.core.window.WindowBase.sizefrom kivy.core.window import Windowsize = Window.size print("display size =", size)
On Mon, May 14, 2018 at 3:11 AM, Auggie <theviol...@gmail.com> wrote:
Is there a way to get the device's screen resolution with Kivy, so I can assign it to a variable? I have been using PyAutoGUI for that purpose, but would much rather do it with Kivy, if possible.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.
# -*- coding: utf-8 -*-
from kivy.app import App
from kivy.uix.label import Label
from kivy.core.window import Window
class TestApp(App):
def build(self):
label = Label(text="Initial Size = {0}".format(Window.size))
def on_size(win, size):
label.text = "on_size. Size={0}".format(size)
Window.bind(size=on_size)
return label
TestApp().run()