本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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:
//.........这里部分代码省略.........