本文整理汇总了C#中Camera.SetViewport方法的典型用法代码示例。如果您正苦于以下问题:C# Camera.SetViewport方法的具体用法?C# Camera.SetViewport怎么用?C# Camera.SetViewport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera
的用法示例。
在下文中一共展示了Camera.SetViewport方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_SetViewport
public void Test_SetViewport()
{
var cam = new Camera ();
cam.SetViewport (0.1f, 0.2f, 0.3f, 0.4f);
Assert.AreEqual (0.1f, cam.Viewport.X);
Assert.AreEqual (0.2f, cam.Viewport.Y);
Assert.AreEqual (0.3f, cam.Viewport.Width);
Assert.AreEqual (0.4f, cam.Viewport.Height);
}
示例2: Create
public static Node Create()
{
var cmp = new MyCamera ();
var cam = new Camera ();
cam.SetScreen (0, 0, 800, 600);
cam.SetViewport (0, 0, 1, 1);
var node = new Node ("Camera");
node.Attach (cmp);
node.Attach (cam);
return node;
}
示例3: Create
public static Node Create()
{
var cam = new Camera ();
cam.ClearEnabled = false;
cam.SetScreen (0, 0, 1920, 1200);
cam.SetViewport (0.75f, 0.05f, 0.2f, 0.2f);
var cmp = new MyCamera1 ();
var node = new Node ("Camera2");
node.Attach (cmp);
node.Attach (cam);
return node;
}
示例4: Create
public static Node Create()
{
var cam = new Camera ();
cam.SetScreen (0, 0, 800, 600);
cam.SetViewport (0, 0, 1, 1);
var cmp = new MyCamera1 ();
cmp.MoveSpeed = 10;
cmp.RotateSpeed = 3;
cmp.ZoomSpeed = 0.1f;
var node = new Node ("Camera1");
node.Attach (cmp);
node.Attach (cam);
node.Translate (-400, -300, 0);
return node;
}