Webmaster4o
Nov 07, 2015 - 00:16
I've written some incredibly basic code for a custom view class that can be dragged/dropped.
class DragDrop(ui.View):
def touch_moved(self, touch):
tx, ty = touch.location
self.x,self.y = tx-self.frame[2]/2, ty-self.frame[3]/2
v=ui.View()
dnd = DragDrop(frame=(100,100,100,100))
dnd.background_color=(0,0,0)
v.add_subview(dnd)
v.present(hide_title_bar=1)
However when I drag an object, its position flickers between two positions. Why is this, and how can I fix it?