def populate_tiles(self):
if not self._tileset:
self._tilemap.clear()
surface = self._presenter.surface
tiles_width = int(math.floor(surface.width / float(Tilemap.TILE_SIZE)))
tiles_height = int(math.ceil(len(self._tileset.tiles) / float(tiles_width)))
tiles = range(0, len(self._tileset.tiles))
self._tilemap = Tilemap(tiles, tiles_width, tiles_height)
self._camera.set_max(tiles_width * Tilemap.TILE_SIZE, tiles_height * Tilemap.TILE_SIZE)
self.Scrollbar.SetScrollbar(wx.VERTICAL, 0, surface.height, tiles_height, True)
self.Scrollbar.SetThumbPosition(0)
评论列表
文章目录