示例#1
0
 public void Init()
 {
     screen = new FakeScreen ();
     effect = new FakeEffect (screen);
     world = new World (screen: screen, drawOrder: DisplayLayer.GameWorld, effect: effect, bounds: screen.Bounds);
     cam1 = new Camera (screen: screen, world: world);
 }
示例#2
0
 public void Bounds_Grow_Test()
 {
     FakeScreen screen2 = new FakeScreen (width: 1000, height: 1000);
     Bounds bounds = new Bounds (screen: screen2, relX: 0.100f, relY: 0.100f, relWidth: 0.300f, relHeight: 0.700f);
     Assert.IsTrue (boundsEqual (bounds.Grow (5), new Bounds (screen: screen2, relX: 0.095f, relY: 0.095f, relWidth: 0.310f, relHeight: 0.710f)));
     Assert.IsTrue (boundsEqual (bounds.Grow (5, 2), new Bounds (screen: screen2, relX: 0.095f, relY: 0.098f, relWidth: 0.310f, relHeight: 0.704f)));
     Assert.IsTrue (boundsEqual (bounds.Shrink (5), new Bounds (screen: screen2, relX: 0.105f, relY: 0.105f, relWidth: 0.290f, relHeight: 0.690f)));
     Assert.IsTrue (boundsEqual (bounds.Shrink (5, 2), new Bounds (screen: screen2, relX: 0.105f, relY: 0.102f, relWidth: 0.290f, relHeight: 0.696f)));
 }
示例#3
0
 public void Init()
 {
     fakeScreen = new FakeScreen ();
     point = new ScreenPoint (fakeScreen, 0, 0);
     size = new ScreenPoint (fakeScreen, 1, 1);
     testPoint = new ScreenPoint (fakeScreen, 0.5f, 0.5f);
     bound = new Bounds (point, size);
 }