def load(self): data = None if self.game_dict: data = self.game_dict else: with open("game_save.json", "r") as read_file: data = json.load(read_file) if data: self.engine.restore_from_dict(data) viewport(self.engine.player.center_x, self.engine.player.center_y)
def __init__(self): super(view_manager, self).__init__() self._event = 0 self._run = 0 self._subrun = 0 self._xCenter = 0 self._yCenter = 0 self._zCenter = 0 self._fileReader = None self._input_file = None self._events = [] self._eventItr = 0 self._currentData = [] self._gl_hits = None self._detectorView = viewport.viewport() self._layout = QtGui.QVBoxLayout() self._layout.addWidget(self._detectorView) self._isCycling = False
def addEvdDrawer(self, plane, cryostat=0): self._drawerList[(plane, cryostat)] = viewport(self._geometry, plane, cryostat) self._drawerList[(plane, cryostat)].connectWireDrawingFunction( self.drawWireOnPlot) self._drawerList[(plane, cryostat)].drawHitsRequested.connect( self.hitOnWireHandler) # self._drawerList.append(viewport(self._geometry, plane, cryostat)) # self._drawerList[-1].connectWireDrawingFunction(self.drawWireOnPlot) # self._drawerList[-1].drawHitsRequested.connect(self.hitOnWireHandler) self._nviews += 1
def __init__(self): super(view_manager, self).__init__() self._layout = QtGui.QVBoxLayout() self._detectorView = viewport() self._layout.addWidget(self._detectorView) self._plotView = None self.getPlot() #self._layout.addWidget(self._plotView) self._gl_hits = None
def setup(self): """LOOK機能、character_screen画面, level_up画面、ノーマルstate時のUIの初期化を行う ミニマップ作成の情報もここで渡す """ self.engine.setup() viewport(self.engine.player.center_x, self.engine.player.center_y) # ここでminimapの作成を行う # ------------------------------------------------------------------------------ # ミニマップの描画位置指定 screen_size = (SCREEN_WIDTH, SCREEN_HEIGHT) self.program = self.ctx.load_program( vertex_shader=arcade.resources.shaders.vertex.default_projection, fragment_shader=arcade.resources.shaders.fragment.texture) # ピクセルの色を保存するために色の添付ファイルを追加します self.color_attachment = self.ctx.texture((screen_size), components=4, filter=(gl.GL_NEAREST, gl.GL_NEAREST)) # 必要な色を添付したフレームバッファを作成する self.offscreen = self.ctx.framebuffer( color_attachments=[self.color_attachment]) self.quad_fs = geometry.quad_2d_fs() self.mini_map_quad = geometry.quad_2d( size=(0.31, .31), pos=(.824, -.8)) # ------------------------------------------------------------------------------- # Lコマンドで呼び出すlook機能 self.select_UI = SelectUI(engine=self.engine) self.character_UI = CharacterScreenUI(engine=self.engine) self.level_up_window = LevelupUI() self.level_up_flower = LevelUpFlower(self.engine) self.normal_UI = NormalUI(self.engine)
def addEvdDrawer(self,plane): self._drawerList.append(viewport(self._geometry, plane)) self._drawerList[-1].connectWireDrawingFunction(self.drawWireOnPlot) self._drawerList[-1].drawHitsRequested.connect(self.hitOnWireHandler) self._nviews += 1
def on_draw(self): """全画像の表示""" arcade.start_render() # minimap start ------------------------------------------------------------------------------------------------------------ """minimap draw""" if self.engine.game_state == GAME_STATE.NORMAL: self.offscreen.use() # self.offscreen.clear(arcade.color.BLACK) arcade.set_viewport(0, GAME_GROUND_WIDTH, 0, GAME_GROUND_HEIGHT+GRID_SIZE*2) self.engine.cur_level.map_point_sprites.draw() arcade.draw_rectangle_filled(center_x=self.engine.player.center_x, center_y=self.engine.player.center_y, width=45, height=45, color=arcade.color.BLUE) self.engine.cur_level.item_point_sprites.draw() self.use() self.color_attachment.use(0) self.quad_fs.render(self.program) # minimap end ------------------------------------------------------------------------------------------------------------- # アタック時はビューポート固定する if self.engine.game_state == GAME_STATE.NORMAL: if self.engine.player.state == state.ON_MOVE: viewport(self.engine.player.center_x, self.engine.player.center_y) # viewport(self.engine.player.from_x, self.engine.player.from_y) else: x, y = (grid_to_pixel(self.engine.player.x, self.engine.player.y)) viewport(x,y) # ビューポート情報取得(この位置で取得しないとバグる) self.viewports = arcade.get_viewport() # arcadeの光源効果 with self.engine.light_layer: self.draw_sprites() self.engine.light_layer.draw(ambient_color=(1,1,1)) # ノーマルステート時の画面表示 if self.engine.game_state == GAME_STATE.NORMAL or self.engine.game_state == GAME_STATE.DELAY_WINDOW: self.normal_UI.draw_in_normal_state(self.viewports) # damage表示 for i in self.engine.damage_pop: if i.dist > 40: self.engine.damage_pop.remove(i) elif i.dist < 30: i.draw() # Character_Screen表示 elif self.engine.game_state == GAME_STATE.CHARACTER_SCREEN: self.character_UI.draw_character_screen(arcade.get_viewport(), self.engine.selected_item) # inventory表示 elif self.engine.game_state == GAME_STATE.INVENTORY: draw_inventory(self.engine, self.engine.selected_item, self.viewports) # level_up画面表示 elif self.engine.game_state == GAME_STATE.LEVEL_UP_WINDOW: self.level_up_window.window_pop(self.viewports, self.engine) elif self.engine.game_state == GAME_STATE.LEVEL_UP_FLOWER: self.level_up_flower.window_pop(self.viewports) # LOOKシステム elif self.engine.game_state == GAME_STATE.SELECT_LOCATION or self.engine.game_state == GAME_STATE.LOOK: # lookカーソルにviewportを渡す x, y = grid_to_pixel(self.select_UI.grid_select[0]+self.engine.player.x, self.select_UI.grid_select[1]+self.engine.player.y) viewport(x, y) # Lookメイン関数 self.select_UI.draw_in_select_ui(self.viewports, self.engine) # draw the mini_map(この位置に置かないとバグる) if self.engine.game_state == GAME_STATE.NORMAL: self.color_attachment.use(0) self.mini_map_quad.render(self.program)
query = "-1" check_query = False #print('canonical') canonical(hash, tree) #print('kw') kw(hash, tree, query, check_query) kw_in_url(hash, result_url, query, check_query) keyword_density(hash, query, soup, check_query) #print('title_h1') title_h1(hash, tree) #print('viewport') viewport(hash, code) #print('description') description(hash, tree) #print('title') title(hash, tree) #print('links') links(hash, result_main, html_source) #print('plugins') plugins(hash, html_source, html_comments) #print('https') https(result_url, hash)