Пример #1
0
        public TutorialForm(Competitions competitions)
        {
            var engine = competitions.Engine as CVARCEngine;

            InitializeComponent();
            ClientSize          = new Size(800, 600);
            ScoreDisplayControl = new ScoreDisplayControl {
                Scores = competitions.Score
            };
            tableLayoutPanel1.Controls.Add(new DrawerControl(new DirectXFormDrawer(engine.DrawerFactory.GetDirectXScene(), new DrawerSettings {
                ViewMode = ViewModes.Top
            })), 1, 0);
            for (int i = 0; i < competitions.RobotCount; ++i)
            {
                tableLayoutPanel1.Controls.Add(new DrawerControl(new DirectXFormDrawer(engine.DrawerFactory.GetDirectXScene(), new DrawerSettings
                {
                    BodyCameraLocation = new Frame3D(30, 0, 30, Angle.FromGrad(-45), Angle.Zero, Angle.Zero),
                    Robot    = engine.GetBody(competitions.Robots[i].Name),
                    ViewMode = ViewModes.FirstPerson
                })), 0, 0);
            }
            tableLayoutPanel1.Controls.Add(ScoreDisplayControl, 1, 1);
            foreach (Control control in tableLayoutPanel1.Controls)
            {
                control.Anchor = AnchorAll;
            }
            competitions.CycleFinished += (s, a) =>
            {
                try
                {
                    BeginInvoke(new Action(UpdateScores));
                }
                catch { }
            };
        }
Пример #2
0
		public void TwoControlsPlacement()
		{
			_form = new Form {ClientSize = new Size(800, 600)};
			var cameraSwitch = new CameraSwitchControl(new SwitchableCamera(new Body(), Frame3D.Identity, _form, Frame3D.Identity));

			_form.Controls.Add(cameraSwitch);
			var scoreDisplay = new ScoreDisplayControl();

			_form.Controls.Add(scoreDisplay);
			CheckAnchoredRight(scoreDisplay);
			CheckAnchoredLeft(cameraSwitch);

		}
Пример #3
0
        public void TwoControlsPlacement()
        {
            _form = new Form {
                ClientSize = new Size(800, 600)
            };
            var cameraSwitch = new CameraSwitchControl(new SwitchableCamera(new Body(), Frame3D.Identity, _form, Frame3D.Identity));

            _form.Controls.Add(cameraSwitch);
            var scoreDisplay = new ScoreDisplayControl();

            _form.Controls.Add(scoreDisplay);
            CheckAnchoredRight(scoreDisplay);
            CheckAnchoredLeft(cameraSwitch);
        }