当前位置: 首页>>代码示例>>Python>>正文


Python Camera.switch_viewpoint方法代码示例

本文整理汇总了Python中Camera.Camera.switch_viewpoint方法的典型用法代码示例。如果您正苦于以下问题:Python Camera.switch_viewpoint方法的具体用法?Python Camera.switch_viewpoint怎么用?Python Camera.switch_viewpoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Camera.Camera的用法示例。


在下文中一共展示了Camera.switch_viewpoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: IncantusLayer

# 需要导入模块: from Camera import Camera [as 别名]
# 或者: from Camera.Camera import switch_viewpoint [as 别名]

#.........这里部分代码省略.........
        glDisable(GL_DEPTH_TEST)
        self.draw_overlay()
        self.camera.reset()
        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE)

    def draw_overlay(self):
        # draw left mask
        self.set_2d(-50, 50)
        self.phase_status.render()
        self.phase_bar.render()
        self.otherplayer_hand.render()
        self.player_hand.render()
        self.stack.render()
        self.otherplayer_status.render()
        self.mainplayer_status.render()
        #self.game_status.render()
        self.zone_animator.render2d()
        self.msg_dialog.render()
        self.selection.render()
        #glDisable(GL_TEXTURE_2D)
        self.unset_2d()

    def on_key_press(self, symbol, modifiers):
        if symbol == key.ENTER:
            self.process_action(engine.Action.PassPriority())
        elif symbol == key.ESCAPE:
            self.process_action(engine.Action.CancelAction())
        #elif symbol == key.L and modifiers & key.MOD_SHIFT:
        #    self.game_status.toggle_gamelog()
        elif symbol == key.D and modifiers & key.MOD_SHIFT:
            import pdb
            pdb.set_trace()
        elif symbol == key.V and modifiers & key.MOD_SHIFT:
            self.camera.switch_viewpoint()
        elif symbol == key.F:
            self.finish_turn = True
            self.process_action(engine.Action.PassPriority())
        elif symbol == key.F1:
            show_ingame_menu(self)
        elif symbol == key.F2:
            self.phase_controller.activate(other=False)
        elif symbol == key.F3:
            self.phase_controller.activate(other=True)
        elif symbol == key.Q:
            self.soundfx.disconnect()
            quit()
        elif symbol == key.F7:
            pyglet.image.get_buffer_manager().get_color_buffer().save('screenshot.png')
        else:
            return event.EVENT_UNHANDLED
        return True

    def set_2d(self, near, far):
        glMatrixMode(GL_PROJECTION)
        glPushMatrix()
        glLoadIdentity()
        glOrtho(0, self.width, 0, self.height, near, far)
        glMatrixMode(GL_MODELVIEW)
        glPushMatrix()
        glLoadIdentity()

    def unset_2d(self):
        glPopMatrix()
        glMatrixMode(GL_PROJECTION)
        glPopMatrix()
        glMatrixMode(GL_MODELVIEW)
开发者ID:Incantus,项目名称:incantus,代码行数:70,代码来源:Incantus.py


注:本文中的Camera.Camera.switch_viewpoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。