Tener instalado la libreria kivy, copiar la imagen a la carpeta del programa.
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.graphics import Color, Ellipse, Rectangle, Line
from kivy.core.image import Image
class MyPaintWidget(Widget):
a=[[1,1]]
def on_touch_down(self, touch):
with self.canvas:
self.a.append([touch.x,touch.y])
Color(0, 0.5, 0)
Rectangle(pos=(0,0), size=self.size)
Rectangle(source="nave.png", pos=(touch.x, touch.y), size=(100,100))
class MyPaintApp(App):
def build(self):
return MyPaintWidget()
if __name__ == '__main__':
MyPaintApp().run()
e-mail: minuvasoft10@gmail.com Programador de Proyectos Software.
No hay comentarios:
Publicar un comentario