Пример #1
0
 def __init__(self, x, y, width, height):
     Layer.__init__(self, x, y, width, height, [255.0, 0.0, 0.0])
     Hotspot.__init__(self, x, y, width, height, columns=len(CommandBar.BUTTONS), hover_type=Hotspot.HOVER_CLICK)
     
     self.batches = graphics.Batch()
     self.commands = []
     for text in CommandBar.BUTTONS:
         self.create_label(text)
     
     self.redistribute_labels()
Пример #2
0
 def __init__(self, x, y, width, height):
     Layer.__init__(self, x, y, width, height, [255.0, 0.0, 255.0])
     
     self.batches = graphics.Batch()
     self.items = []
     
     self.line_quantity = height / GameView.EFFECTS_LINE_HEIGHT
     for i in range(self.line_quantity):
         self.items.append(text.Label(font_name=GameView.FONT_NAME, font_size=GameView.EFFECTS_FONT_SIZE, x=x, y=y+i*GameView.EFFECTS_LINE_HEIGHT, batch=self.batches))
     
     Hotspot.__init__(self, x, y, width, height, rows=self.line_quantity)
Пример #3
0
 def update(self, components = None):
     world = State.model().game
     Layer.update(self, components)
     
     Hotspot.__init__(self, self.x, self.y, self.width, self.height, world.rows, world.columns)
     
     if components is None or 'cursor' in components:
         self.update_cursor();
     elif components == None:
         y = 0
         for depth in xrange(-world.depth, world.height):
             floor = World.FLOORS[depth]
             self.items[0][y].text = floor['name']
             self.items[0][y].depth = depth
             y += 1
Пример #4
0
 def __init__(self, x, y, width, height, font_name=View.FONT_NAME, font_size=View.FONT_SIZE, line_height=(View.FONT_SIZE*1.2), columns=1, column_width=None):
     ListLayer.__init__(self, x, y, width, height, font_name, font_size, line_height, columns, column_width)
     
     hotspot_height = self.line_height*self.rows
     hotspot_y = y + height - hotspot_height
     Hotspot.__init__(self, x, hotspot_y, self.column_width*self.columns, hotspot_height, rows=self.rows, columns=self.columns)
Пример #5
0
 def __init__(self, x, y, width, height, rows=1, columns=1, hover_type=Hotspot.HOVER_HIDDEN):
     Hotspot.__init__(self, x, y, width, height, rows, columns, hover_type)