add sample image
This commit is contained in:
parent
bce36ff0e1
commit
a1c838d300
2 changed files with 14 additions and 4 deletions
BIN
images/player.png
Normal file
BIN
images/player.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
18
main.py
18
main.py
|
@ -1,12 +1,22 @@
|
||||||
from kivy.app import App
|
from kivy.app import App
|
||||||
|
from kivy.clock import Clock
|
||||||
from kivy.uix.label import Label
|
from kivy.uix.label import Label
|
||||||
|
from kivy.uix.widget import Widget
|
||||||
|
from kivy.graphics import Rectangle
|
||||||
|
|
||||||
|
class GameWidget(Widget):
|
||||||
|
def __init__(self,**kwargs):
|
||||||
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
|
with self.canvas:
|
||||||
|
Rectangle(source="images/player.png", pos=(0,0), size=(100,100))
|
||||||
|
|
||||||
|
|
||||||
class GlobalForest(App):
|
class GlobalForest(App):
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
return Label(text='Hello world')
|
#return Label(text='Hello world')
|
||||||
|
return GameWidget()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
GlobalForest().run()
|
app = GlobalForest()
|
||||||
|
app.run()
|
||||||
|
|
Loading…
Reference in a new issue