I have a code, but when it executed it gives a black screen. Tell me what's wrong with it, please. I try to make a background from a picture on the screen in kivy. Here is my .py file:
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from kivy.graphics import Color, Rectangle
from kivy.uix.image import Image
Builder.load_file("Layout.kv")
class SpaceAdventure(App):
def build(self):
return RootManager()
class RootManager(ScreenManager):
pass
class StartScreen(Screen):
pass
if __name__ == '__main__':
SpaceAdventure().run()here
There is my kv file:
<RootScreen>:
transition: FadeTransition()
StartScreen:
<StartScreen>:
name: "start"
canvas.before:
Rectangle:
pos: self.pos
size: self.size
source: 'test.jpg'
FloatLayout:
orientation: 'vertical'
MyButton:
text: 'Start'
<MyButton@Button>:
background_color: 1, 1, 1, 1
bold: True