def __init__(self, parent): UIWndBase.__init__(self, GameData.BATTLEGROUND_AREA, parent) self.surface = GameData.TOPSCREEN_SURF #直接画到屏幕surface, 不经过顶级窗口(优化) self.entire_surface = self.surface #游戏世界全局surface. 设置战场后更新为地图大小 self.viewport = GameData.BATTLEGROUND_AREA #视口Rect self.viewport_speed = 20 #滚屏速度(每帧象素) self.screen_moving = 'x' #滚屏状态. #必须在外部调用set_battle完成初始化 self.battle = None #战场对象.类型Battle self.map = None #地图对象 self.entire_surface = None #mouse status self.ms_leftdown = False self.selected_rect = None #框选的矩形 self.selecting_loc = False #鼠标正在选择建造地点 self.active_selected = None self.building_mask = None #建筑选择地点时的mask self.mask_size = (0,0) self.mask_conflict = False #建筑与其他单位相交 #环境对象 imgs = ImageHelper.load_imagelist('gather_flag.png') self.sp_gatherpoint = EnvironObject(imgs) self.envir_objects = EnvObjectGroup() self.envir_objects.add(self.sp_gatherpoint) self.gather_point = (0,0) self.show_gather_point = False
def load_images(panel): panel.images = ImageHelper.load_imagelist('icon_tfac.png', 'icon_repair.png', 'icon_sell.png')
def loadimages(): HeadQuarter.images = ImageHelper.load_imagelist('head_quarter.png')
def loadimages(): Tank.images = ImageHelper.load_imagelist('mtank_1_0.png', 'mtank_1_1.png', 'mtank_1_2.png', 'mtank_1_3.png', 'mtank_1_4.png', 'mtank_1_5.png', 'mtank_1_6.png', 'mtank_1_7.png')