Created
June 19, 2017 15:05
-
-
Save Exodus111/0662a52f9942a29828a7c5d83c5f078e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import kivy | |
kivy.require("1.9.0") | |
from kivy.app import App | |
from kivy.uix.widget import Widget | |
from kivy.uix.image import Image | |
from kivy.graphics import Rectangle | |
from kivy.clock import Clock | |
from kivy.properties import ObjectProperty | |
class Main(Widget): | |
foreground = ObjectProperty(None) | |
background = ObjectProperty(None) | |
def setup(self): | |
with self.canvas: | |
Rectangle(texture=self.background.texture, pos=[200,200], size_hint_x=None, size_hint_y=None, size=[800, 800]) | |
Rectangle(texture=self.foreground.texture, pos=[200,200], size_hint_x=None, size_hint_y=None, size=[800, 800]) | |
def update(self, dt): | |
pass | |
class ImageCheckApp(App): | |
def build(self): | |
game = Main() | |
game.setup() | |
Clock.schedule_interval(game.update, 1/60) | |
return game | |
if __name__ == "__main__": | |
app = ImageCheckApp() | |
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#: kivy 1.9.1 | |
<Main>: | |
foreground: fg | |
background: bg | |
IMG: | |
id: fg | |
source: "background.png" | |
IMG: | |
id: bg | |
source: "foreground.png" | |
<IMG@Image>: | |
allow_stretch: True | |
keep_ratio: True | |
size_hint_x: None | |
size_hint_y: None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment