tileselector.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:Turrican2Editor 作者: GitExl 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号