コード例 #1
0
        void Start()
        {
            _controller = HelloApp.App.Get<GameController>();
              var model = _controller.SceneInfo().Model.As<SceneInfoViewModel>();
              _cam = model.Camera;

              var text = new nText(new Vector2(1.0f, 1.0f));
              text.Font = (Font) Resources.Load("Fonts/vinchard");
              text.FontSize = 0.5f;
              text.Text = "Select the type of tree you want to grow...";
              text.Color = new Color(0.3f, 0.3f, 0.3f);
              var p = new nProp(text);
              p.Visible = true;
              p.Position = new Vector2(-5.2f, 2.5f);

              p = new nProp("tree.1", new Vector2(2.0f, 2.0f));
              p.Visible = true;
              p.Position = new Vector2(-4.35f, -0.3f);
              p.Listen(_cam, nInputEvent.ENTER, delegate { SetNotice("Lovie", bTreeType.TREE_1, new Vector2(-4.72f, -1.5f)); });
              p.Listen(_cam, nInputEvent.EXIT, delegate { SetNotice(""); });
              p.Listen(_cam, nInputEvent.DOWN, delegate {
            HelloApp.App.Get<TreeController>().Index().Activate();
              });

              p = new nProp("tree.2", new Vector2(2.0f, 2.0f));
              p.Visible = true;
              p.Position = new Vector2(-0.35f, -0.3f);
              p.Listen(_cam, nInputEvent.ENTER, delegate { SetNotice("Nujiper", bTreeType.TREE_2, new Vector2(-0.80f, -1.5f)); });
              p.Listen(_cam, nInputEvent.EXIT, delegate { SetNotice(""); });
              p.Listen(_cam, nInputEvent.DOWN, delegate {
            HelloApp.App.Get<TreeController>().Index().Activate();
              });

              p = new nProp("tree.3", new Vector2(2.0f, 2.0f));
              p.Visible = true;
              p.Position = new Vector2(3.35f, -0.3f);
              p.Listen(_cam, nInputEvent.ENTER, delegate { SetNotice("Pamle", bTreeType.TREE_3, new Vector2(2.97f, -1.5f)); });
              p.Listen(_cam, nInputEvent.EXIT, delegate { SetNotice(""); });
              p.Listen(_cam, nInputEvent.DOWN, delegate {
            HelloApp.App.Get<TreeController>().Index().Activate();
              });

              text = new nText(new Vector2(1.0f, 1.0f));
              text.Font = (Font) Resources.Load("Fonts/vinchard");
              text.FontSize = 0.4f;
              text.Text = "";
              text.Color = new Color(0.2f, 0.5f, 0.2f);
              _notice = new nProp(text);
              _notice.Visible = true;
              _notice.Position = new Vector2(-2.0f, -3.5f);
              SetNotice("Nujiper", bTreeType.TREE_2, new Vector2(-0.8f, -1.5f));
        }
コード例 #2
0
        void Start()
        {
            _controller = HelloApp.App.Get<GameController>();
              var model = _controller.SceneInfo().Model.As<SceneInfoViewModel>();
              _cam = model.Camera;

              var p = new nProp("Title", new Vector2(8.0f, 4.0f));
              p.Visible = true;
              p.Position = new Vector2(0f, 1.7f);

              var b = new nButton() {
            Camera = _cam,
            Color = Color.black,
            Texture = "new",
            OverTexture = "new.active",
            DownTexture = "new.click",
            Position = new Vector2(-.5f, -1.5f),
            Size = new Vector2(2.59f, 1.00f),
            Text = "",
            Action = delegate {
              _controller.SelectTree().Activate();
            }
              };
              b.Manifest();

              var text = new nText(new Vector2(1.0f, 1.0f));
              text.Font = (Font) Resources.Load ("Fonts/vinchard");
              text.Text = "by One Thousand Faces";
              text.FontSize = 0.3f;
              text.Color = new Color(0.4f, 0.4f, 0.4f);
              p = new nProp(text);
              p.Visible = true;
              p.Position = new Vector2(3f, -3f);

              text = new nText(new Vector2(1.0f, 1.0f));
              text.Font = (Font) Resources.Load ("Fonts/vinchard");
              text.Text = "Sandra Lim & Douglas Linder";
              text.FontSize = 0.2f;
              text.Color = new Color(0.7f, 0.7f, 0.7f);
              p = new nProp(text);
              p.Visible = true;
              p.Position = new Vector2(3f, -3.4f);
        }
コード例 #3
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);
        }