I'm creating a game in kivy and noticed that the window size is always 25% bigger than I specify it to be:
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.core.window import Window
# screen dimensions, px
screen_width = 400
screen_height = 600
Window.size = (screen_width, screen_height)
class PlayGame(Widget):
def on_touch_move(self, touch):
self.touch = touch
print(self.touch.x, self.touch.y)
class TestGame(App):
def build(self):
return PlayGame()
if __name__ == '__main__':
game = TestGame()
game.run()
Running this code, then clicking my mouse and running it down the side of the screen gives a width of 500 and doing the same along the top gives a height of 750.
I have looked in the kivy docs, but all it has for the window size is
Get the rotated size of the window. If rotation is set, then the size will change to reflect the rotation.
New in version 1.0.9.
size is an AliasProperty.
I'm not sure that any of this helps, expecially given that the window is not rotated.
from Why is the kivy window automatically 25% bigger than specified?
No comments:
Post a Comment