本文整理汇总了C#中Camera.SetScreen方法的典型用法代码示例。如果您正苦于以下问题:C# Camera.SetScreen方法的具体用法?C# Camera.SetScreen怎么用?C# Camera.SetScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera
的用法示例。
在下文中一共展示了Camera.SetScreen方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_SetupCamera
public void Test_SetupCamera()
{
var g2d = Graphics2D.GetInstance ();
var win = g2d.GetWindow () as RenderWindow;
var cam = new Camera ();
cam.SetScreen (0, 0, 640, 480);
cam.Viewport = new Rectangle (0.25f, 0.25f, 0.5f, 0.5f);
var node = new Node ();
node.Attach (cam);
cam.SetupView (win);
var view = win.GetView ();
Assert.AreEqual (640, view.Size.X);
Assert.AreEqual (480, view.Size.Y);
Assert.AreEqual (320, view.Center.X);
Assert.AreEqual (240, view.Center.Y);
Assert.AreEqual (0.25f, view.Viewport.Top);
Assert.AreEqual (0.25f, view.Viewport.Left);
Assert.AreEqual (0.5f, view.Viewport.Width);
Assert.AreEqual (0.5f, view.Viewport.Height);
}
示例2: Test_SetScreen
public void Test_SetScreen()
{
var cam = new Camera ();
cam.SetScreen (1, 2, 3, 4);
Assert.AreEqual (ProjectionType.Screen, cam.Type);
Assert.AreEqual (1, cam.Screen.X);
Assert.AreEqual (2, cam.Screen.Y);
Assert.AreEqual (3, cam.Screen.Width);
Assert.AreEqual (4, cam.Screen.Height);
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}