上面的代码是
[RenPy] 纯文本查看 复制代码 frame id "card_area":
xsize 320
ysize 320
at ca_pos(0.05, 0.9, 1.0)
for card in my_cards:
$ p = card.get_pos(my_cards.index(card), len(my_cards))
add card.pic_url at ca_pos(p[0], p[1], 0.625) rotate p[2] rotate_pad False
其中
[RenPy] 纯文本查看 复制代码 transform ca_pos(x,y,z = 1.0):
zoom z
align (x, y) alpha 0.0
linear 0.1 alpha 1.0
[RenPy] 纯文本查看 复制代码 init -1 python:
class Card:
def __init__(self, card_type = 0, hover_sound_url = "audio/click.wav"):
self.card_type = card_type
self.card_text = "card_text"
self.pic_url = self.get_card_pic(card_type)
self.hover_sound_url = hover_sound_url
if card_type == 3:
self.hover_sound_url = "audio/ding.wav"
def get_card_pic(self, type):
card_pic_list = ["gui/icon/card green.png", "gui/icon/card yellow.png",
"gui/icon/card red.png", "gui/icon/card blue.png"]
# card_pic_list = ["c1", "c2", "c3", "c4"]
return card_pic_list[type]
## 获得位置三元组
def get_pos(self, i, num):
mid = [0.5, 0.5, 0]
m_num = num/2
k = 0.8 / num
# if int(m_num) == m_num:
x = 0.5 - (m_num - i) * k
y = 0.5
r = 0 - (m_num - i) * 5
return [x,y,r] |