def __init__(self, window, surface): MapTools.__init__(self, 0, 0) Drawable.__init__(self) self.window = window self.surface = surface self.accepted = False self.observed = set() self.tiles = [] self.map = defaultdict(lambda: defaultdict(lambda: 'fog')) self.world_size = 0 self.background = 'fog' self.main_tile = 'fog'
def __init__(self, surface): GuiElement.__init__(self, surface) Drawable.__init__(self) self.slots = {} self.key_to_num = {k:i+1 for i,k in enumerate(self.control_keys)} self.x = 100 self.y = 300 self.dy = 40 self.tilenames = {} for item_type_name in dir(item_types): item_type = getattr(item_types, item_type_name) if hasattr(item_type, 'tilename'): tilename = item_type.tilename type_name = item_type.__name__ self.tilenames[type_name] = tilename self.title = Label(self.surface, 'Equipment:', self.x, self.y) self.tiles = []
def __init__(self, surface): GuiElement.__init__(self, surface) Drawable.__init__(self) self.slots = {} self.key_to_num = {k: i + 1 for i, k in enumerate(self.control_keys)} self.x = 100 self.y = 300 self.dy = 40 self.tilenames = {} for item_type_name in dir(item_types): item_type = getattr(item_types, item_type_name) if hasattr(item_type, 'tilename'): tilename = item_type.tilename type_name = item_type.__name__ self.tilenames[type_name] = tilename self.title = Label(self.surface, 'Equipment:', self.x, self.y) self.tiles = []
def __init__(self, window, surface): Drawable.__init__(self) ViewTools.__init__(self, window, surface, dynamic_objects) self.focus_object = False
def draw(self): self.title.draw() Drawable.draw(self)
def __init__(self, window, surface): Drawable.__init__(self) ViewTools.__init__(self, window, surface, static_objects) GuiElement.__init__(self, surface) self.prev_hovered = False
def draw(self): x, y = self.get_shift().get() self.surface.draw_background(x, y, self.background) Drawable.draw(self)
def draw(self): x,y = self.get_shift().get() self.surface.draw_background(x,y, self.background) Drawable.draw(self)