public void GetReferences() { player_health = UserInterface.Active.Root.Find <RichParagraph>("player_health"); enemy_health = UserInterface.Active.Root.Find <RichParagraph>("enemy_health"); for (int i = 0; i < UserInterface.Active.Root.Children.Count; i++) { Console.WriteLine(UserInterface.Active.Root.Children[i].Identifier); } }
public LoggerHelper() { _panelConsole = new Panel(new Vector2(0.7f, PANEL_HEIGHT), PanelSkin.Simple, Anchor.BottomLeft) { Padding = Vector2.Zero, PanelOverflowBehavior = PanelOverflowBehavior.VerticalScroll }; _panelConsole.Scrollbar.AdjustMaxAutomatically = true; _paragraphConsole = new RichParagraph("teste", scale: 0.97f); _panelConsole.AddChild(_paragraphConsole); }
private void initialize() { Panel panel = new Panel(); panel.Anchor = Anchor.TopLeft; panel.MaxSize = new Vector2(220, 110); rich1 = new RichParagraph(); rich2 = new RichParagraph(); panel.AddChild(rich1); panel.AddChild(rich2); UserInterface.Active.Root.AddChild(panel); /* * ProgressBar progress = new ProgressBar(0, 100); * progress.Value = 50; * * panel.AddChild(progress);*/ }
public override void Draw() { if (has_drawn) { return; } UserInterface.Active.Clear(); RichParagraph player_health = new RichParagraph("{{RED}}player_health", Anchor.BottomLeft); player_health.Identifier = "player_health"; UserInterface.Active.AddEntity(player_health); RichParagraph enemy_health = new RichParagraph("{{RED}}enemy_health", Anchor.BottomRight); enemy_health.Identifier = "enemy_health"; UserInterface.Active.AddEntity(enemy_health); Button rtn_menu = new Button("Return to Debug1", ButtonSkin.Fancy, Anchor.TopCenter); rtn_menu.OnClick = (Entity btn) => { Console.WriteLine("Opening Debug Menu 1"); app.Notify(src.notifications.UINotifications.LoadNewScene, this, "debug.menu1"); }; UserInterface.Active.AddEntity(rtn_menu); Button test_punch = new Button("TestPunch", ButtonSkin.Fancy, Anchor.Center); test_punch.OnClick = (Entity btn) => { Console.WriteLine("PUNCH!!!"); app.Notify(src.notifications.CardUseNotifications.PlayCombatCard, this, new Punch(), app.model.combat_model.Arena.PlayerCharacter, app.model.combat_model.Arena.Enemy, app.model.combat_model.Arena.Environment); app.Notify(src.notifications.CombatEventNotification.UpdateBattleView, this, null); }; UserInterface.Active.AddEntity(test_punch); has_drawn = true; }