public nView SceneInfo(float vsize)
 {
     var model = new SceneInfoViewModel();
       model.Camera = new nCamera(vsize);
       model.Camera.Active = true;
       model.Camera.Background = Color.white;
       _session.Game.Camera = model.Camera;
       return View(model);
 }
        public nView SceneInfo()
        {
            var model = new SceneInfoViewModel();
              model.Camera = new nCamera(10.0f);
              model.Camera.Active = true;
              model.Camera.Background = Color.gray;

              model.BackButton = model.Button("Back", delegate {
            HelloApp.App.Get<HomeController>().Menu().Activate();
              });
              model.BackButton.Position = new Vector2(-5.0f, -4.0f);

              return View(model);
        }
Exemplo n.º 3
0
    private void SetupButtons(SceneInfoViewModel model)
    {
        _editEnabled = new nProp("edit", new Vector2(0.5f, 0.5f));
        _editDisabled = new nProp("edit.disabled", new Vector2(0.5f, 0.5f));
        _editEnabled.Listen(_cam, nInputEvent.UP, delegate {
          SetEditState(false);
        });
        _editDisabled.Listen(_cam, nInputEvent.UP, delegate {
          SetEditState(true);
        });
        SetEditState(false);

        var p = new nProp("btn-play", new Vector2(0.5f, 0.5f));
        p.Visible = true;
        p.Position = new Vector2(-4.45f, 3.0f);
        p.Listen(_cam, nInputEvent.UP, delegate {
          nLog.Debug("Play!!");
          SetEditState(false);
          _controller.UpdateGameSpeed(0.4f);
        });

        p = new nProp("btn-faster", new Vector2(0.5f, 0.5f));
        p.Visible = true;
        p.Position = new Vector2(-3.90f, 3.0f);
        p.Listen(_cam, nInputEvent.UP, delegate {
          SetEditState(false);
          _controller.UpdateGameSpeed(0.9f);
        });

        _controller.UpdateGameSpeed(0.4f);
        _controller.UpdateTime(5.0f, false);

        /*model.Button("Pause", delegate {
          Trace("Paused!");
          _controller.SetPaused(true);
        }, new Vector2(5.0f, 3.0f)).Manifest();

        model.Button("Start", delegate {
          var response = _controller.SetPaused(false);
          if (response.Success)
        Trace("Started~ (you should see an animation now depending on game speed... :P)");
          else
        Trace("You need to create a new tree by clicking 'reset' first");
        }, new Vector2(5.0f, 2.5f)).Manifest();

        model.Button("Reset", delegate {
          _controller.Reset();
          if (_lastTree != null)
        _lastTree.Visible = false;
          _lastTree = null;
        }, new Vector2(5.0f, 2.0f)).Manifest();

        model.Button("Slower", delegate {
          _controller.UpdateGameSpeed(-0.05);
        }, new Vector2(5.0f, 1.5f)).Manifest();

        model.Button("Faster", delegate {
          _controller.UpdateGameSpeed(0.05);
        }, new Vector2(5.0f, 1.0f)).Manifest();

        model.Button("Dump Config", delegate {
          _controller.DumpConfig();
        }, new Vector2(5.0f, 0.5f)).Manifest();*/

        var light_font = (Font) Resources.Load ("Fonts/vinchard");
        _trace = new nText(new Vector2(3.0f, 1.0f));
        _trace.Color = Color.black;
        _trace.FontSize = 0.2f;
        _trace.Font = light_font;
        _trace.Text = "";
        _traceProp = new nProp(_trace);
        _traceProp.Visible = true;
        _traceProp.Position = new Vector2(-7.0f, 4.5f);

        var d = new nText(new Vector2(3.0f, 2.0f));
        d.Color = Color.black;
        d.FontSize = 0.4f;
        d.Font = light_font;
        d.Text = "90 days left";
        _date = new nProp(d);
        _date.Visible = true; /* redraw text */
        _date.Position = new Vector2(3.5f, 3.2f);

        d = new nText(new Vector2(3.0f, 2.0f));
        d.Color = new Color (0.6f, 0.6f, 0.6f);
        d.FontSize = 0.25f;
        d.Font = light_font;
        d.Text = "";
        _speed = new nProp(d);
        _speed.Visible = true; /* redraw text */
        _speed.Position = new Vector2(3.6f, 2.75f);
    }
        public nView SceneInfo()
        {
            if (_cam == null) {
            _cam = new nCamera(10.0f);
            _session.Game.Camera = _cam;
              }

              var model = new SceneInfoViewModel();
              model.Camera = _cam;
              model.Camera.Active = true;
              model.Camera.Background = new Color(1f, 1f, 1f, 0f);

              model.BackButton = model.Button("Back", delegate {
            HelloApp.App.Get<HomeController>().Menu().Activate();
              });
              model.BackButton.Position = new Vector2(-5.0f, -3.0f);

              return View(model);
        }