저는 libavg와 일련의 RectNodes를 사용하여 프로젝트 작업을하고 있습니다. 내가하려고하는 일은 각 노드가 2,5 초 동안 흰색으로 점등 된 다음 다시 사라지는 애니메이션을 재생하는 것입니다. 노드 중 하나를 클릭 할 때마다 해당 특정 노드에 대해 동일한 애니메이션이 발생해야합니다.libavg로 파이썬에서 "깜박임"애니메이션
나는 AVGApp 클래스를 사용하고및 RectNode ID가 목록과 그들이 생각하는 방법을 몇 번 깜박 대한 (ID1, 2)
def playAnim(self, animarr):
for i in range(0, len(animarr)):
i, count = animarr[i]
sid = "r" + str(i)
node = g_player.getElementByID(sid)
while count > 0:
self.blink(node)
count -= 1
return
내 코드처럼, 불 :
def _enter(self):
(some other stuff here)
print "Let's get started!"
self.playAnim(self.animArr)
print "Your turn!"
어떤 도움을 주시면 더 좋구요의 libavg 참조가 도움이되지 않습니다
def blink(self, node):
pos = node.pos
size = node.size
covernode = avg.RectNode(pos=pos, size=size, fillopacity=0,
parent = self._parentNode, fillcolor="ffffff",
color="000000", strokewidth=2)
self.animObj = LinearAnim(covernode, 'fillopacity', 1000, 0, 1)
self.animObj.start()
self.animObj = LinearAnim(covernode, 'fillopacity', 1000, 1, 0)
self.animObj.start()
covernode.unlink(True)
return
나는 그것을 전화 드렸습니다 나 많이.