Kivy를 사용하여 배경 이미지를 표시하려고하므로 루트 위젯을 이미지와 동일한 크기로 만듭니다. 현재 kv 파일에서 이미지를로드하면 왼쪽 아래 모서리에 작은 축소판으로 나타납니다. 응용 프로그램 창이 올바른 (실제 크기) 크기에 대한 것으로 보이지만 알기는 어렵습니다. 아래의 코드, 어떤 생각?이미지 크기가 Kivy에서 잘못되었습니다
.kv 파일 :
#:kivy 1.8.0
<BarBot_splash>:
BoxLayout:
size: image.size
Image:
id: image
source: 'MainMenu.png'
평 파일 : 그것의 아이들에게 어떤 위치 나 크기를 적용하지 않도록
import kivy
kivy.require('1.8.0')
from kivy.app import App
from kivy.uix.widget import Widget
class BarBot_splash(Widget):
def on_touch_up(self, touch):
if touch.x < self.width/3:
#we touched the menu button
pass
elif touch.x > self.width/3*2:
#we touched the custom button
pass
else:
return False
class BarBot(App):
def build(self):
return BarBot_splash()
if __name__=='__main__':
BarBot().run()