Пример #1
0
	def test_pan_clamps_the_center_of_the_camera_within_the_bounds_of_the_map(self):  # noqa
		tmap = TileMap(TileGrid(Size(12, 16)), tile_sz=Size(10, 10))
		cam = Camera(tmap)
		cam.pan(Vector(-65, 165))
		self.assertEqual(
			cam.view_rect,
			Rectangle(Point(-60, 80), Size(120, 160)),
			)
Пример #2
0
	def test_pan_moves_the_view_rectangle_by_a_supplied_vector(self):
		tmap = TileMap(TileGrid(Size(12, 16)), tile_sz=Size(10, 10))
		cam = Camera(tmap)
		cam.pan(Vector(3, 4))
		self.assertEqual(cam.view_rect, Rectangle(Point(3, 4), Size(120, 160)))