本文整理汇总了Python中client.ui.controls.Panel类的典型用法代码示例。如果您正苦于以下问题:Python Panel类的具体用法?Python Panel怎么用?Python Panel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Panel类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, game_id, *a, **k):
Panel.__init__(
self, width=550, height=340,
zindex=10000,
*a, **k
)
self.game_id = game_id
self.x = (self.overlay.width - 550) // 2
self.y = (self.overlay.height - 340) // 2
self.btncancel = btncancel = Button(
u'取消', parent=self, x=440, y=25, width=90, height=40
)
self.labels = pyglet.graphics.Batch()
Label(
u'旁观游戏', font_size=12, x=275, y=306,
anchor_x='center', anchor_y='bottom',
color=Colors.green.heavy + (255, ),
shadow=(2, 207, 240, 156, 204),
batch=self.labels,
)
@btncancel.event
def on_click():
self.delete()
Executive.call('query_gameinfo', ui_message, game_id)
示例2: __init__
def __init__(self, trans, parent, *a, **k):
Panel.__init__(
self, x=1, y=1, width=1, height=1, zindex=5, parent=parent,
*a, **k
)
self.lbls = pyglet.graphics.Batch()
self.trans = trans
示例3: __init__
def __init__(self, g, *a, **k):
Panel.__init__(self, width=550, height=340, zindex=10000, *a, **k)
parent = self.parent
self.x = (parent.width - 550) // 2
self.y = (parent.height - 340) // 2
self.textarea = ta = TextArea(
parent=self, x=30, y=30, width=550-30, height=340-60,
font_size=12,
)
ta.text = u''
winners = g.winners
for p in g.players:
s = u'|G%s|r(|R%s|r, |c0000ffff%s|r, %s)\n' % (
p.ui_meta.char_name, p.account.username.replace('|', '||'),
g.ui_meta.identity_table[p.identity.type],
u'|R胜利|r' if p in winners else u'失败'
)
ta.append(s)
if g.me in winners:
self.pic = gres.win
else:
self.pic = gres.lose
close = Button(
u'关闭', parent=self, x=440, y=25, width=90, height=40
)
@close.event
def on_click():
self.delete()
示例4: __init__
def __init__(self, trans, *a, **k):
self.trans = trans
self.pbar = None
g = Game.getgame()
choices = trans.mapping[g.me]
w, h = 500 + 1*160, 390 + 1*113
Panel.__init__(self, width=w, height=h, zindex=5, *a, **k)
p = self.parent
pw, ph = p.width, p.height
self.x, self.y = (pw-w)/2, (ph-h)/2
self.inputlet = None
choices = self.choices = [c for c in choices if c.char_cls and not getattr(c, 'chosen', False)]
self.selectors = selectors = []
for i, c in enumerate(choices):
y, x = divmod(i, 4)
x, y = 15 + 160*x, 45 + 113*(3-y)
gs = GirlSelector(c, selectors, parent=self, x=x, y=y)
@gs.event
def on_dblclick(gs=gs):
c = gs.choice
ilet = self.inputlet
if not c.chosen and ilet:
ilet.set_choice(c)
ilet.done()
self.end_selection()
selectors.append(gs)
示例5: __init__
def __init__(self, text, *a, **k):
Panel.__init__(self, *a, **k)
self.zindex = 100
w, h = self.width, self.height
ta = TextArea(parent=self, font_size=12, x=2, y=60, width=w - 4, height=h - 4 - 60)
ta.append(text)
btn = Button(u"关闭", parent=self, x=(w - 120) // 2, y=20, width=120, height=40)
@btn.event
def on_click():
self.delete()
示例6: __init__
def __init__(self, character, *a, **k):
self.character = character
ShownCardPanel.current = self
categories = character.showncardlists
h = 30 + len(categories)*145 + 10
w = 100 + 6*93.0+30
self.lbls = lbls = pyglet.graphics.Batch()
Panel.__init__(self, width=1, height=1, zindex=5, *a, **k)
y = 30
i = 0
for cat in reversed(categories):
Label(
text=CardList.ui_meta.lookup[cat.type], x=30, y=y+62+145*i, font_size=12,
color=(255, 255, 160, 255), shadow=(2, 0, 0, 0, 130),
anchor_x='left', anchor_y='center', batch=lbls,
)
ca = DropCardArea(
parent=self,
x=100, y=y+145*i,
fold_size=6,
width=6*93, height=125,
)
for c in cat:
cs = CardSprite(c, parent=ca)
cs.associated_card = c
ca.update()
i += 1
p = self.parent
self.x, self.y = (p.width - w)//2, (p.height - h)//2
self.width, self.height = w, h
self.update()
btn = ImageButton(
common_res.buttons.close_blue,
parent=self,
x=w-20, y=h-20,
)
@btn.event
def on_click():
self.delete()
示例7: delete
def delete(self):
Panel.delete(self)
ShownCardPanel.current = None
示例8: draw
def draw(self):
Panel.draw(self)
self.lbls.draw()
示例9: draw
def draw(self):
Panel.draw(self)
self.labels.draw()
示例10: draw
def draw(self):
Panel.draw(self)
pic = self.pic
glColor3f(1, 1, 1)
self.pic.blit(self.width - pic.width - 10, self.height - pic.height - 10)
示例11: __init__
def __init__(self, selection_mode=0, *a, **k):
self.selection_mode = selection_mode
self.lbls = pyglet.graphics.Batch()
self.selection = []
Panel.__init__(self, width=1, height=1, *a, **k)