public nButton Button(string text, nPropClick onClick) { var b = new nButton() { Camera = Camera, Color = Color.black, Font = "Fonts/Roboto-Regular", Texture = "menu.button.1", FontSize = 0.2f, Position = new Vector2(-5.0f, 3.0f), Size = new Vector2(2.8f, 0.4f), Text = text, Action = onClick }; return b; }
public nButton Button(string text, nPropAction onClick, Vector2 position) { var b = new nButton() { Camera = Camera, Color = Color.black, Font = "Fonts/Roboto-Regular", Texture = "menu.button.1", OverTexture = "menu.button.2", DownTexture = "menu.button.3", FontSize = 0.2f, Position = position, Size = new Vector2(2.8f, 0.4f), Text = text, Action = onClick }; return b; }
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); }
private void DisplayTime(int days, int hours) { var msg = String.Format("Bonsai Bloom - Day {0}", days); var tm = _date.Component<TextMesh>(); tm.text = msg; if ((days >= MAX_GAME_TIME) && (!done)) { _controller.SetPaused(true); _controller.Lock(); var b = new nButton() { Text = "", Texture = "done", Position = new Vector2(-6f, -1f), Camera = _cam, Size = new Vector2(3.75f, 2.95f), Depth = -0.2f, Action = delegate { HelloApp.App.Get<GameController>().Score().Activate(); } }; b.Manifest(); done = true; } }
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); }