Example #1
0
        void Start()
        {
            _controller = HelloApp.App.Get<GameController>();
              var model = _controller.SceneInfo(14.0f).Model.As<SceneInfoViewModel>();
              _cam = model.Camera;

              var fortune = Fortunes.Next();
              var offset = new Vector2((float) (53 - (int) fortune[2]) * 0.1f, 0f);

              var text = new nText(new Vector2(1.0f, 1.0f));
              text.Font = (Font) Resources.Load("Fonts/vinchard");
              text.FontSize = 0.45f;
              text.Text = (string) fortune[0];
              text.Color = new Color(0.2f, 0.2f, 0.2f);
              var p = new nProp(text);
              p.Visible = true;
              p.Position = new Vector2(-4.0f, -3.5f) + offset;

              text = new nText(new Vector2(1.0f, 1.0f));
              text.Font = (Font) Resources.Load("Fonts/vinchard");
              text.FontSize = 0.35f;
              text.Text = (string) fortune[1];
              text.Color = new Color(0.5f, 0.5f, 0.5f);
              p = new nProp(text);
              p.Visible = true;
              p.Position = new Vector2(-4.0f, -3.0f) + offset;

              /*p = new nProp("pot", new Vector2(2.0f, 2.0f));
              p.Visible = true;
              p.Position = new Vector2(0f, -1.25f);
              p.Depth = 6.0f;
              p.Color = new Color(0.5f, 0.5f, 0.5f);*/

              /*p = new nProp("square-pot", new Vector2(4.5f, 2.0f));
              p.Visible = true;
              p.Position = new Vector2(0f, -1.7f);
              p.Depth = 7.0f;
              p.Color = new Color(0.5f, 0.5f, 0.5f);*/

              p = new nProp("oval-pot", new Vector2(3.85f, 1.5f));
              p.Visible = true;
              p.Position = new Vector2(-0.15f, -1.47f);
              p.Scale = new Vector2(1.2f, 1.1f);
              p.Depth = 7.0f;
              p.Color = new Color(0.5f, 0.5f, 0.5f);

              b = new nButton() {
            Text = "Return to menu",
            Font = "Fonts/vinchard",
            Position = new Vector2(6.0f, 5.5f),
            FontSize = 0.5f,
            Camera = _cam,
            Size = new Vector2(4.0f, 1.0f),
            Color = new Color(0.2f, 0.2f, 0.2f),
            Texture = "Menu.button.0",
            Action = delegate {
              _controller.Index().Activate();
            }
              };
              b.Manifest();

              b2 = new nButton() {
            Text = "Download this Bonsai",
            Font = "Fonts/vinchard",
            Position = new Vector2(-6.7f, 5.5f),
            FontSize = 0.5f,
            Camera = _cam,
            Size = new Vector2(4.0f, 1.0f),
            Color = new Color(0.2f, 0.2f, 0.2f),
            Texture = "Menu.button.0",
              };
              b2.Action = delegate {
            StartCoroutine(WaitingForSS());
              };
              b2.Manifest();

              bLeaf.MagicOffset = -1f;
              var tree = HelloApp.App.Get<TreeController>().ForceTreeRedraw().Model.As<bTreeTestViewModel>();
              tree.Data.TreeView.Tree.Position = new Vector2(0f, -1f);
        }