コード例 #1
0
 def build_map(self, map_initializer, fast, use_beach_tiler, load_tilers):
     cs = self.me.cell_size
     n_submaps_per_map = 36
     n_time_frames = 16
     n_maps_on_screen = 9
     some_random_factor = 2.
     N = int(n_submaps_per_map * n_time_frames * n_maps_on_screen *
             some_random_factor)
     print("***INITIAL", N)
     map_initializer.init_loading_bar()
     map_initializer.update_loading_bar("Initializing surfaces", 0.)
     for i in range(N):
         nsubmap_x = SUBMAP_FACTOR // cs
         submap_size = (nsubmap_x * cs, ) * 2
         self.me.surfaces32.append(pygame.Surface(submap_size))
     map_initializer.build_map(self.me,
                               fast,
                               use_beach_tiler,
                               load_tilers,
                               build_gui=self.is_main)
     self.map_initializer = map_initializer
     self.me.build_objects_dict()
     self.collect_path_objects(map_initializer)
     if self.is_main:
         thorpy.add_time_reaction(self.me.e_box, self.func_reac_time)
         ui = gui.Gui(self)
コード例 #2
0
    def __init__(self):
        self.gui = gui.Gui()
        self.camera = camera.Camera()
        self.detect = detect.Detect()
        self.outImage = []
        self.outText = {}
        self.outFilename = 'XJTU-XJTUfly3-Rx.txt'

        self.exsdic = {"CA001": 0,"CA002": 0,"CA003": 0,"CA004": 0,"CD001": 0,"CD002": 0,"CD003": 0,"CD004": 0,"CD005": 0,"CD006": 0,"ZA001": 0,"ZA002": 0,"ZA003": 0,
           "ZA004": 0,"ZA005": 0,"ZA006": 0,"ZB001": 0,"ZB002": 0,"ZB003": 0,"ZB004": 0,"ZB005": 0,"ZB006": 0,"ZB007": 0,"ZB008": 0,"ZB009": 0,"ZB010": 0,
           "ZC001": 0,"ZC002": 0,"ZC003": 0,"ZC004": 0,"ZC005": 0,"ZC006": 0,"ZC007": 0,"ZC008": 0,"ZC009": 0,"ZC010": 0,"ZC011": 0,"ZC012": 0,"ZC013": 0,
           "ZC014": 0,"ZC015": 0,"ZC016": 0,"ZC017": 0,"ZC018": 0,"ZC019": 0,"ZC020": 0,"ZC021": 0,"ZC022": 0,"ZC023": 0}
        self.numdic = {"CA001": 0,"CA002": 0,"CA003": 0,"CA004": 0,"CD001": 0,"CD002": 0,"CD003": 0,"CD004": 0,"CD005": 0,"CD006": 0,"ZA001": 0,"ZA002": 0,"ZA003": 0,
           "ZA004": 0,"ZA005": 0,"ZA006": 0,"ZB001": 0,"ZB002": 0,"ZB003": 0,"ZB004": 0,"ZB005": 0,"ZB006": 0,"ZB007": 0,"ZB008": 0,"ZB009": 0,"ZB010": 0,
           "ZC001": 0,"ZC002": 0,"ZC003": 0,"ZC004": 0,"ZC005": 0,"ZC006": 0,"ZC007": 0,"ZC008": 0,"ZC009": 0,"ZC010": 0,"ZC011": 0,"ZC012": 0,"ZC013": 0,
           "ZC014": 0,"ZC015": 0,"ZC016": 0,"ZC017": 0,"ZC018": 0,"ZC019": 0,"ZC020": 0,"ZC021": 0,"ZC022": 0,"ZC023": 0}
        self.doubledic = {"CA001": 0,"CA002": 0,"CA003": 0,"CA004": 0,"CD001": 0,"CD002": 0,"CD003": 0,"CD004": 0,"CD005": 0,"CD006": 0,"ZA001": 0,"ZA002": 0,"ZA003": 0,
           "ZA004": 0,"ZA005": 0,"ZA006": 0,"ZB001": 0,"ZB002": 0,"ZB003": 0,"ZB004": 0,"ZB005": 0,"ZB006": 0,"ZB007": 0,"ZB008": 0,"ZB009": 0,"ZB010": 0,
           "ZC001": 0,"ZC002": 0,"ZC003": 0,"ZC004": 0,"ZC005": 0,"ZC006": 0,"ZC007": 0,"ZC008": 0,"ZC009": 0,"ZC010": 0,"ZC011": 0,"ZC012": 0,"ZC013": 0,
           "ZC014": 0,"ZC015": 0,"ZC016": 0,"ZC017": 0,"ZC018": 0,"ZC019": 0,"ZC020": 0,"ZC021": 0,"ZC022": 0,"ZC023": 0}
        self.tridic = {"CA001": 0,"CA002": 0,"CA003": 0,"CA004": 0,"CD001": 0,"CD002": 0,"CD003": 0,"CD004": 0,"CD005": 0,"CD006": 0,"ZA001": 0,"ZA002": 0,"ZA003": 0,
           "ZA004": 0,"ZA005": 0,"ZA006": 0,"ZB001": 0,"ZB002": 0,"ZB003": 0,"ZB004": 0,"ZB005": 0,"ZB006": 0,"ZB007": 0,"ZB008": 0,"ZB009": 0,"ZB010": 0,
           "ZC001": 0,"ZC002": 0,"ZC003": 0,"ZC004": 0,"ZC005": 0,"ZC006": 0,"ZC007": 0,"ZC008": 0,"ZC009": 0,"ZC010": 0,"ZC011": 0,"ZC012": 0,"ZC013": 0,
           "ZC014": 0,"ZC015": 0,"ZC016": 0,"ZC017": 0,"ZC018": 0,"ZC019": 0,"ZC020": 0,"ZC021": 0,"ZC022": 0,"ZC023": 0}

        self.finaldic = {"CA001": 0,"CA002": 0,"CA003": 0,"CA004": 0,"CD001": 0,"CD002": 0,"CD003": 0,"CD004": 0,"CD005": 0,"CD006": 0,"ZA001": 0,"ZA002": 0,"ZA003": 0,
           "ZA004": 0,"ZA005": 0,"ZA006": 0,"ZB001": 0,"ZB002": 0,"ZB003": 0,"ZB004": 0,"ZB005": 0,"ZB006": 0,"ZB007": 0,"ZB008": 0,"ZB009": 0,"ZB010": 0,
           "ZC001": 0,"ZC002": 0,"ZC003": 0,"ZC004": 0,"ZC005": 0,"ZC006": 0,"ZC007": 0,"ZC008": 0,"ZC009": 0,"ZC010": 0,"ZC011": 0,"ZC012": 0,"ZC013": 0,
           "ZC014": 0,"ZC015": 0,"ZC016": 0,"ZC017": 0,"ZC018": 0,"ZC019": 0,"ZC020": 0,"ZC021": 0,"ZC022": 0,"ZC023": 0}
コード例 #3
0
    def __init__(self):
        self.gui = gui.Gui()
        self.camera = camera.Camera()
        self.detect = detect.Detect()
        self.outImage = []
        self.position = {}
        self.outText = {}
        self.outFilename = 'XJTU-XJTUfly3-Rx.txt'
        # 背景图像堆栈
        self.img_stack = []

        # 识别处理
        self.his = []      # 储存历史的识别记录
        self.OutText = {}  # 作为一个背景下的所有数据
        self.all = {}      # 最后作为输出
コード例 #4
0
ファイル: main.py プロジェクト: YannThorimbert/RpgMap
##game.add_object((18,10), game.windmill)
##game.add_tower((15,12), humans)
##game.set_flag((18,5), humans.flag, humans.team)

##game.set_flag((15,7), humans.flag, 1)
##game.set_fire((15,7), 2)
##game.add_smoke("small", (8,8))
##game.add_smoke("large", (10,8))

##game.get_cell_at(15,14).set_name("My top cell")

#### GUI and events part #######################################################


ui = gui.Gui(game)
game.set_ambiant_sounds(False)

thorpy.add_time_reaction(me.e_box, game.func_reac_time)

game.gui.footstep = get_sprite_frames("sprites/footstep.png", s=12,
                                        resize_factor=0.6)
game.gui.sword = get_sprite_frames("sprites/sword_shine.png")
game.gui.medic = get_sprite_frames("sprites/medic.png", s=16)
game.gui.under_construct = get_sprite_frames("sprites/under_construction.png", s=16)
game.gui.under_capture = get_sprite_frames("sprites/under_capture.png", s=16)

game.update_player_income(game.current_player)
game.gui.e_gold_txt.set_text(str(game.current_player.money))
game.gui.empty_star = get_sprite_frames("sprites/star_empty.png", s=13)[0]
game.gui.plain_star = get_sprite_frames("sprites/star_plain.png", s=13)[0]
コード例 #5
0
ファイル: main.py プロジェクト: KuroBayashi/Python_A_Star
 def __init__(self):
     self.m_gui = gg.Gui()
コード例 #6
0
from image_reader import read
from gui import gui
from ip.find_mask import find_masks
import cv2
import numpy as np

show_ui = True

if __name__ == '__main__':
    gui = gui.Gui()
    input_image = 'a.jpeg'  # input("please input path to image")
    img = read(input_image)
    gui.add(img, "Original")
    ret, mask = find_masks(img, gui.add)
    gui.add(mask)

    gui.add(mask)
    cv2.imwrite('mask.jpeg', mask)

    if show_ui:
        gui.show()
コード例 #7
0
def main():
    back = out.Backend()
    prog = gui.Gui(back)
    return 0
コード例 #8
0
ファイル: plume.py プロジェクト: harvey-git/skribisto
def launch_gui(core):
    from gui import gui
    gui = gui.Gui(core)
    gui.init_gui()

    return gui
コード例 #9
0
#!/usr/bin/env python
#=[site officiel]=========================
#<<<<<fusion files QT by W3YZOH0RTH>>>>>
#============[http://progject.free.fr/]===
import PyQt4.Qt as qt
import gui.gui as GUI
import sys

app = qt.QApplication(sys.argv)
gui = GUI.Gui(sys.argv)
gui.show()
sys.exit(app.exec_())