Get the screen size of the device

5,676 views
Skip to first unread message

dennyb87

unread,
Dec 20, 2012, 8:37:11 AM12/20/12
to kivy-...@googlegroups.com
How to get the screen size of the device?

Akshay Arora

unread,
Dec 20, 2012, 9:58:32 AM12/20/12
to kivy-...@googlegroups.com
http://kivy.org/docs/api-kivy.core.window.html#kivy.core.window.WindowBase.size
On Thu, Dec 20, 2012 at 7:07 PM, dennyb87 <dennyb...@gmail.com> wrote:
How to get the screen size of the device?

--
 
 

dennyb87

unread,
Dec 20, 2012, 11:10:30 AM12/20/12
to kivy-...@googlegroups.com
Ok i read the doc but I don't understand whats the way to get it (the screen size) :( !

Akshay Arora

unread,
Dec 20, 2012, 11:49:50 AM12/20/12
to kivy-...@googlegroups.com
You can get the size of the Window as through Window.size. Screen resolution would be different on different devices/monitors you will have to call different api's for most. Easiest way I can think of is on systems where you can set kivy window to full screen and get the window size. Either through the config http://kivy.org/docs/api-kivy.config.html or through the cmd line args (try `python kivyapp.py --help` to see the available options). For android and  ios the app should be fullscreen anyways so getting the window.size should give you the screen resolution. You can combine that and the dpi info from kivy.metrics to calculate the "screen size".

On Thu, Dec 20, 2012 at 9:40 PM, dennyb87 <dennyb...@gmail.com> wrote:
Ok i read the doc but I don't understand whats the way to get it (the screen size) :( !

--
 
 

Reply all
Reply to author
Forward
0 new messages