Пример #1
0
 def __init__(self, width, height):
     x = 12
     y = 2
     width += self.offset
     height += self.offset
     Window.__init__(self, x, y, width, height)
     self.font = pygame.font.SysFont("timesnewroman", 40, bold=True, italic=True)
     self.create_contents()
     self.mapname = None
Пример #2
0
 def __init__(self, size, game_map):
     x = 12
     y = 48
     w = size[0] + self.offset
     h = size[1] + self.offset
     Window.__init__(self, x, y, w, h)
     self.map = game_map
     screen = pygame.display.get_surface()
     self.image = screen.subsurface((x, y), (w, h))
     self.create_contents()
     self.last_param = None
     pygame.display.get_surface()
Пример #3
0
 def __init__(self, gamemap):
     w = 512 / 2 + 2 * self.offset
     h = 640 / 2 + 2 * self.offset
     screen_w, screen_h = pygame.display.get_surface().get_size()
     x = screen_w - w
     y = screen_h - h
     Window.__init__(self, x, y, w, h)
     self.map = gamemap
     self.selected_rect = Rect(self.offset, self.offset, 32, 32)
     self.tileset = 0
     self._tileref = 0
     self.create_contents()
     self.need_refresh = True
     self.windowskin = Cache.load_windowskin("editor.png")
Пример #4
0
 def __init__(self, window_tileset):
     h_max = WindowThumbTile.H_MAX
     w = 2 * self.offset + 64 + self.font.size("h = 99 ")[0]
     h = 2 * self.offset + 32 + 8 * h_max + self.font.get_linesize()
     screen_w, screen_h = pygame.display.get_surface().get_size()
     x = screen_w - w
     y = 0
     Window.__init__(self, x, y, w, h)
     self.tile = IsoTile(0, 0)
     self.h = 0  # map.get_height(i, j)
     self.window_tileset = window_tileset
     self.last_param = None
     self.create_contents()
     self.windowskin = Cache.load_windowskin("editor.png")
     self.update()
Пример #5
0
 def draw(self, destsurf):
     if self.need_refresh:
         self.refresh()
         Window.draw(self, destsurf)
Пример #6
0
 def draw(self, surf):
     self.draw_widgets()
     Window.draw(self, surf)
Пример #7
0
 def draw(self, destsurf):
     if self.need_refresh:
         self.need_refresh = False
         Window.draw(self, destsurf)