当您右键单击画布时,为什么the first widget example在kivy中会在黄色中间导致橙色圆圈?当您单击左键时,为纯黄色圆圈?
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.graphics import Color, Ellipse
class MyPaintWidget(Widget):
def on_touch_down(self, touch):
with self.canvas:
Color(1, 1, 0)
d = 30.
Ellipse(pos=(touch.x - d/2, touch.y - d/2), size=(d, d))
class MyPaintApp(App):
def build(self):
return MyPaintWidget()
if __name__ == '__main__':
MyPaintApp().run()
2 回答
要禁用多点触控仿真,请在导入任何其他kivy模块之前将其添加到包含main函数的源文件中:
这是多点触控仿真,你可以在这里看到如何禁用它
http://kivy.org/docs/api-kivy.input.providers.mouse.html