forked from kkuramitsu/anime2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pien003
21 lines (18 loc) · 832 Bytes
/
pien003
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from anime2021.anime import AShape, AStudio, RollingPolygon, AImage, test_shape
import IPython
pien = 'https://1.bp.blogspot.com/-ZOg0qAG4ewU/Xub_uw6q0DI/AAAAAAABZio/MshyuVBpHUgaOKJtL47LmVkCf5Vge6MQQCNcBGAsYHQ/s1600/pose_pien_uruuru_woman.png'
shape = AImage(100,100,image=pien)
IPython.display.Image(test_shape(shape))
class GuruGuruPien(AShape):
def __init__(self, width=50, height=None, cx=None, cy=None, N=5):
AShape.__init__(self, width, height, cx, cy)
self.poly = RollingPolygon(width, height, N=N)
self.pien = AImage(width, height, image=pien)
def render(self, canvas, tick):
#描画する前に中心座標を同期する
self.poly.cx = self.cx
self.poly.cy = self.cy
self.pien.cx = self.cx
self.pien.cy = self.cy
self.poly.render(canvas, tick)
self.pien.render(canvas, tick)