When specifying sizes and positions use the kivy.metrics dp and sp to use size independent pixels.
See: https://kivy.org/doc/stable/api-kivy.metrics.html?highlight=kivy%20metrics#module-kivy.metrics
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/6c397fd4-2da5-453e-8f68-dd193e5ed857o%40googlegroups.com.
When specifying sizes and positions use the kivy.metrics dp and sp to use size independent pixels.
See: https://kivy.org/doc/stable/api-kivy.metrics.html?highlight=kivy%20metrics#module-kivy.metrics
From: Mateo Aita
Sent: Tuesday, June 9, 2020 6:43 AM
To: Kivy users support
Subject: [kivy-users] Position of layouts and widgets in different android phones
I have been working on a game for android devices using kivy. The problem is that when i tested the apk on different phones, i found out that i do not know how to make the app look the same in every phone no matter how big or small the screen is. I used size_hint and pos_hint properties but i really need help to understand how to correct this issue because i thought that those properties would make things look the same on each screen. You can see an example of the trouble i am facing in the picture i sent. In it, you can see that the size of the field image is not equal to the % of the screen size i want it to be. I think it might be a problem regarding that image. I hope someone could help me, thanks for the time.
--
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-...@googlegroups.com.
If you have any places where you are using values for offsets, positions or size use dp.
Label:
size_hint_y: None
height: dp(48)
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/9b837f25-8bb4-4c9d-a3ce-18443d0418e7o%40googlegroups.com.
size_hint: None, None
size: dp(650), dp(650)
pos: dp(-120), dp(55)
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/9b837f25-8bb4-4c9d-a3ce-18443d0418e7o%40googlegroups.com.
On Jun 9, 2020, at 11:31 AM, Mateo Aita <mate...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/7e7fb042-9962-4056-ac9b-2de53eb1b000o%40googlegroups.com.
<foto tact it.png>
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/7e7fb042-9962-4056-ac9b-2de53eb1b000o%40googlegroups.com.
<foto tact it.png>
Try this:
from kivy.app import App
from kivy.lang import Builder
kv = """
RelativeLayout:
Image:
source: 'soccer-game.jpg' # your image here
allow_stretch: True
keep_ratio: True
"""
class SizeFieldApp(App):
def build(self):
return Builder.load_string(kv)
SizeFieldApp().run()
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/e0ca616c-6f89-4482-9df2-ec1ad30bc10bo%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/e0ca616c-6f89-4482-9df2-ec1ad30bc10bo%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/b671088f-38f4-4d1c-91d5-cb7fc7ddd695o%40googlegroups.com.
<foto tact it.png>
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/b671088f-38f4-4d1c-91d5-cb7fc7ddd695o%40googlegroups.com.
<foto tact it.png>
😊
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/10b33406-b6c8-4b74-b682-7e6331a75228o%40googlegroups.com.