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); }
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); }
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; }
private void LoadPage(string id) { var pageStyle = new Style.PageStyle(GameApp.Service<Styler>().GetPageStyle(id)); pageStyle.Initialize(); if (!m_pages.ContainsKey(id)) m_pages.Add(id, new MenuPage(pageStyle.TypedTarget)); }