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


C# Camera.Dirty方法代码示例

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


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

示例1: Startup

        public override void Startup()
        {
            Matrix toScreenSpace = Matrix.Identity;
            toScreenSpace.M11 = 2 / 1024.0f;
            toScreenSpace.M22 = 2 / 768.0f;
            toScreenSpace.M41 = -1;
            toScreenSpace.M42 = -1;

            var cam = new Camera
            {
                PostWorldMatrix = toScreenSpace,
                Position = Vector3.UnitZ,
                IsPerspective = false,
                ViewportWidth = 2,
                ViewportHeight = -2
            };
            cam.Dirty();

            Root = new UI.TransformNode
            {
                Transform = cam.WorldToProjectionMatrix,
                Dispatcher = GameApp.Service<UIManager>().Root
            };

            var pageStyle = new Style.PageStyle(GameApp.Service<Styler>().GetPageStyle("Deck"));
            pageStyle.Initialize();
            TextRenderer.FontDescriptor m_msgFont = new TextRenderer.FontDescriptor("Microsoft YaHei", 16);
            m_textFormatOptions = new Graphics.TextRenderer.FormatOptions(m_msgFont);
        }
开发者ID:galaxyyao,项目名称:TouhouGrave,代码行数:29,代码来源:DeckUI.cs

示例2: Startup

        public override void Startup()
        {
            //Init Conversation Manager
            _convManager = new ConversationManager();
            _convManager.Scene = "init";

            Matrix toScreenSpace = Matrix.Identity;
            toScreenSpace.M11 = 2 / 1024.0f;
            toScreenSpace.M22 = 2 / 768.0f;
            toScreenSpace.M41 = -1;
            toScreenSpace.M42 = -1;

            var cam = new Camera
            {
                PostWorldMatrix = toScreenSpace,
                Position = Vector3.UnitZ,
                IsPerspective = false,
                ViewportWidth = 2,
                ViewportHeight = -2
            };
            cam.Dirty();

            Root = new UI.TransformNode
            {
                Transform = cam.WorldToProjectionMatrix,
                Dispatcher = GameApp.Service<UIManager>().Root
            };

            var pageStyle = new Style.PageStyle(GameApp.Service<Styler>().GetPageStyle("Conversation"));
            pageStyle.Initialize();
            ConversationUIPage = pageStyle.TypedTarget;

            ((Panel)pageStyle.ChildIds["ConversationPanel"].Target).MouseButton1Up += new EventHandler<MouseEventArgs>(ConversationUI_MouseButton1Up);
        }
开发者ID:galaxyyao,项目名称:TouhouGrave,代码行数:34,代码来源:ConversationUI.cs

示例3: Startup

        public override void Startup()
        {
            Matrix toScreenSpace = Matrix.Identity;
            toScreenSpace.M11 = 2 / 1024.0f;
            toScreenSpace.M22 = 2 / 768.0f;
            toScreenSpace.M41 = -1;
            toScreenSpace.M42 = -1;

            float fov = MathUtils.PI / 4;
            float nearPlaneHeight = 2 * 0.1f * (float)Math.Tan(fov * 0.5f);
            WorldCamera = new Camera
            {
                Position = new Vector3(0, -1.2f, 2.2f),
                LookAt = new Vector3(0, -0.2f, 0.0f),
                Up = Vector3.UnitZ,
                IsPerspective = true,
                ViewportWidth = nearPlaneHeight * 1.3333f,
                ViewportHeight = nearPlaneHeight
            };
            WorldCamera.Dirty();

            UICamera = new Camera
            {
                PostWorldMatrix = toScreenSpace,
                Position = Vector3.UnitZ,
                IsPerspective = false,
                ViewportWidth = 2,
                ViewportHeight = -2
            };
            UICamera.Dirty();

            InitializeContextButton();
            CreateBindingEvaluator();

            var pageStyle = new Style.PageStyle(GameApp.Service<Styler>().GetPageStyle("InGame"));
            pageStyle.Initialize();
            pageStyle.BindingProvider = this;
            InGameUIPage = pageStyle.TypedTarget;
        }
开发者ID:galaxyyao,项目名称:TouhouGrave,代码行数:39,代码来源:GameUI.cs

示例4: Startup

        public override void Startup()
        {
            #region Initialize Page
            Matrix toScreenSpace = Matrix.Identity;
            toScreenSpace.M11 = 2 / 1024.0f;
            toScreenSpace.M22 = 2 / 768.0f;
            toScreenSpace.M41 = -1;
            toScreenSpace.M42 = -1;

            var cam = new Camera
            {
                PostWorldMatrix = toScreenSpace,
                Position = Vector3.UnitZ,
                IsPerspective = false,
                ViewportWidth = 2,
                ViewportHeight = -2
            };
            cam.Dirty();

            Root = new UI.TransformNode
            {
                Transform = cam.WorldToProjectionMatrix,
                Dispatcher = GameApp.Service<UIManager>().Root
            };

            LoadPage("MainMenu");
            LoadPage("FreeMode");
            LoadPage("Network");
            LoadPage("Quit");

            #endregion

            if (m_isFirstLoaded)
            {
                #region Main Menu
                m_pages["MainMenu"].MenuClicked += (id, item) =>
                {
                    if (id == "freemode")
                    {
                        CurrentPage = m_pages["FreeMode"];
                    }
                    //else if (id == "storymode")
                    //{
                    //    //Test Conversation UI
                    //    CurrentPage = null;
                    //    Root.Dispatcher = null;
                    //    GameApp.Service<GameManager>().EnterConversation();
                    //}
                    else if (id == "makedeck")
                    {
                        CurrentPage = null;
                        Root.Dispatcher = null;
                        GameApp.Service<GameManager>().EnterDeckUI();
                    }
                    else if (id == "quit")
                    {
                        CurrentPage = m_pages["Quit"];
                    }
                };
                #endregion

                #region FreeMode Menu

                PrepareGameStartupParam();

                m_pages["FreeMode"].MenuClicked += (id, item) =>
                {
                    if (id == "vsai" || id == "hotseat")
                    {
                        CurrentPage = null;
                        // detach menu ui
                        Root.Dispatcher = null;

                        Agents.BaseAgent agent0;
                        Agents.BaseAgent agent1;

                        switch (id)
                        {
                            case "vsai":
                                if (GameApp.Instance.GetCommandLineArgValue("playback") != null)
                                {
                                    var pbAgent = new Agents.PlaybackAgent(0);
                                    param.Seed = pbAgent.RandomSeed;
                                    agent0 = pbAgent;
                                }
                                else if (GameApp.Instance.GetCommandLineArgValue("record") != null)
                                {
                                    agent0 = new Agents.LocalPlayerAgent(0, param.Seed);
                                }
                                else
                                {
                                    agent0 = new Agents.LocalPlayerAgent(0);
                                }
                                agent1 = new Agents.AIAgent(1);
                                break;
                            case "hotseat":
                                agent0 = new Agents.LocalPlayerAgent(0);
                                agent1 = new Agents.LocalPlayerAgent(1);
                                break;
                            default:
//.........这里部分代码省略.........
开发者ID:galaxyyao,项目名称:TouhouGrave,代码行数:101,代码来源:MenuUI.cs


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