Beispiel #1
0
 def __init__(self):
     width, height = get_size()
     GUI.__init__(self, width, height)
     self._xpbar = Sprite(image.load(join(path['texture.gui'], 'icons.png')).get_region(0, 187, 182, 5),
             x=(width - 364) / 2, y=48)
     self._xpbar.scale_x = 2
     self._xpbar.scale_y = 1.5
Beispiel #2
0
 def __init__(self):
     width, height = get_size()
     GUI.__init__(self, width, height)
     self._element = {}
     self._element['panel'] = Sprite(image.load(join(path['texture.gui'], 'containers', 'inventory.png')).get_region(0, 90, 176, 166),
             x=(width - 264) / 2, y=(height - 249) / 2)
     self._element['panel'].scale = 1.5
Beispiel #3
0
 def __init__(self):
     width, height = get_size()
     GUI.__init__(self, width, height)
     self._element = []
     self._img = image.load(join(path['texture.ui'], 'bg32.png'))
     for x in range(width // self._img.width + 1):
         for y in range(height // self._img.height + 1):
             sprite = Sprite(self._img, x=x * self._img.width, y = y * self._img.height)
             self._element.append(sprite)
Beispiel #4
0
 def __init__(self):
     width, height = get_size()
     GUI.__init__(self, width, height)
     self._xp_bar = Sprite(image.load(
         join(path['texture.ui'], 'xpbar_empty.png')),
                           x=(width - 450) / 2,
                           y=61)
     self._xp_bar.scale_y = 2
     self._xp_bar.scale_x = 450 / 182
Beispiel #5
0
 def __init__(self):
     width, height = get_size()
     GUI.__init__(self, width, height)
     self._element = {}
     self._element['panel'] = Rectangle(x=(width - 600) / 2,
                                        y=(height - 400) / 2,
                                        width=600,
                                        height=400,
                                        color=(0, 0, 0))
     self._element['panel'].opacity = 200
Beispiel #6
0
 def __init__(self):
     width, height = get_size()
     GUI.__init__(self, width, height)
     self._element = list()
     self._img = image.load(
         join(path['texture.gui'], 'options_background.png'))
     for x in range(width // self._img.width * 2 + 1):
         for y in range(height // self._img.height * 2 + 1):
             sprite = Sprite(self._img,
                             x=x * self._img.width,
                             y=y * self._img.height)
             sprite.scale = 2
             self._element.append(sprite)
Beispiel #7
0
 def __init__(self):
     width, height = get_size()
     GUI.__init__(self, width, height)
     self.dialogue_label = ColorLabel('',
                                      x=2,
                                      y=height - 75,
                                      width=width // 2,
                                      multiline=True)
     # 全部聊天内容
     self.dialogue = []
     # 实际显示的聊天内容
     self.shown = []
     # 最后一条聊天发送的时间
     self.last = time.time()
Beispiel #8
0
 def __init__(self):
     width, height = get_size()
     GUI.__init__(self, width, height)
     self.dialogue_label = pyglet.text.Label('',
                                             x=2,
                                             y=height - 75,
                                             width=width // 2,
                                             font_name='minecraftia',
                                             multiline=True)
     # 全部聊天内容
     self.dialogue = []
     # 实际显示的聊天内容
     self.shown = []
     # 最后一条聊天发送的时间
     self.last = time.time()
Beispiel #9
0
 def __init__(self):
     width, height = get_size()
     GUI.__init__(self, width, height)
     self._index = 0
     self._item = list()
     self._items = list()
     self._hotbar = Sprite(image.load(
         join(path['texture.gui'],
              'widgets.png')).get_region(0, 234, 182, 22),
                           x=(width - 364) / 2,
                           y=0)
     self._select = Sprite(image.load(
         join(path['texture.gui'],
              'widgets.png')).get_region(0, 210, 24, 24),
                           x=(width - 364) / 2 + 40 * self._index - 2,
                           y=-2)
     self._hotbar.scale = 2
     self._select.scale = 2
Beispiel #10
0
 def __init__(self):
     width, height = get_size()
     GUI.__init__(self, width, height)
     self._element = []
     self._items = []
     self._item = []
     self.start = Sprite(image.load(
         join(path['texture.ui'], 'hotbar_start.png')),
                         x=(width - 450) / 2 - 2,
                         y=0)
     self.start.scale = 2.5
     self.end = Sprite(image.load(join(path['texture.ui'],
                                       'hotbar_end.png')),
                       x=(width - 450) / 2 + 450,
                       y=0)
     self.end.scale = 2.5
     for i in range(9):
         self._element.append(
             Sprite(image.load(join(path['texture.ui'],
                                    'hotbar_%d.png' % i)),
                    x=(width - 450) / 2 + 50 * i,
                    y=0))
         self._element[i].scale = 2.5
     self.set_index(0)