internal void LoadCommon(IHUDTheme Theme = null) { if (Theme != null) { theme = Theme; } Viewport v = This.Game.GraphicsDevice.Viewport; scroller = new TextScroller("scroller", theme); scroller.Pos = new Vector2(FrostbyteLevel.BORDER_WIDTH / 2, v.Height - scroller.GetAnimation().Height); scroller.Static = true; fader = new TextFader("fader", theme); fader.Pos = new Vector2(v.Width - 10, v.Height - 10 - 30); fader.Anchor = Orientations.Up_Right; fader.Static = true; #region ItemBag items = new ItemArea("Items", theme); items.Pos = new Vector2(890, 10); items.Static = true; #endregion }
internal ItemArea(string name, IHUDTheme theme) : base(name, new Actor(new DummyAnimation(name, (int)HUD.barSize.X, (int)HUD.barSize.Y))) { ZOrder = 100; this.theme = theme; background = new Texture2D(This.Game.GraphicsDevice, 1, 1); background.SetData(new Color[] { theme.TransparentBackgroundColor }); }
internal TextScroller(string name, IHUDTheme theme, int width, int height) : base(name, new Actor(new DummyAnimation(name, width, height))) { ZOrder = 100; UpdateBehavior = update; this.theme = theme; background = new Texture2D(This.Game.GraphicsDevice, 1, 1); background.SetData(new Color[] { theme.TransparentBackgroundColor }); Center = new Vector2(0, 0); }
internal PlayerHUD(IHUDTheme theme, Player p, int xOffset, int yOffset) { #region Name Text name = new Text("player_name_" + p.Name, "Text", p.Name); name.DisplayColor = theme.TextColor; name.Pos = new Vector2(xOffset, yOffset); name.Static = true; #endregion #region HealthBar healthBar = new ProgressBar("Health_" + p.Name, p.MaxHealth, Color.DarkRed, Color.Firebrick, Color.Black, barSize); healthBar.Pos = new Vector2(xOffset, name.Pos.Y + name.GetAnimation().Height); healthBar.Static = true; healthBar.Value = p.MaxHealth; p.HealthChanged += delegate(object obj, int value) { healthBar.Value = value; if (value == 0) { name.DisplayColor = Color.Tomato; } else { name.DisplayColor = theme.TextColor; } }; #endregion #region ManaBar manaBar = new ProgressBar("Mana_" + p.Name, p.MaxMana, Color.MidnightBlue, Color.Blue, Color.Black, barSize); manaBar.Pos = new Vector2(xOffset, healthBar.Pos.Y + barSize.Y + barSpacing.Y); manaBar.Static = true; manaBar.Value = p.MaxMana; p.ManaChanged += delegate(object obj, int value) { manaBar.Value = value; }; #endregion #region Spell Queue spellQueue = new SpellQueue("Queue", theme, p); spellQueue.Pos = new Vector2(xOffset, healthBar.Pos.Y + barSize.Y + 2 * barSpacing.Y + barSize.Y); spellQueue.Static = true; #endregion }
internal TextFader(string name, IHUDTheme theme, int width, int height) : base(name, new Actor(new DummyAnimation(name, width, height))) { ZOrder = 100; UpdateBehavior = update; this.theme = theme; Center = new Vector2(0, 0); Anchor = Orientations.Left; pendingText = new Queue <string>(); mStates = States().GetEnumerator(); toDisplay = new Text("fader_text", theme.TextFont, ""); toDisplay.Visible = false; toDisplay.DisplayColor = theme.TextColor; toDisplay.Static = true; toDisplay.ZOrder = 101; }
internal TextScroller(string name, IHUDTheme theme) : this(name, theme, This.Game.GraphicsDevice.Viewport.Width - FrostbyteLevel.BORDER_WIDTH, This.Game.GraphicsDevice.Viewport.Height - (int)(2.5f * FrostbyteLevel.BORDER_HEIGHT)) { }
internal TextFader(string name, IHUDTheme theme, int width, int height) : base(name, new Actor(new DummyAnimation(name, width, height))) { ZOrder = 100; UpdateBehavior = update; this.theme = theme; Center = new Vector2(0, 0); Anchor = Orientations.Left; pendingText = new Queue<string>(); mStates = States().GetEnumerator(); toDisplay = new Text("fader_text", theme.TextFont, ""); toDisplay.Visible = false; toDisplay.DisplayColor = theme.TextColor; toDisplay.Static = true; toDisplay.ZOrder = 101; }
internal TextFader(string name, IHUDTheme theme) : this(name, theme, 0, 0) { }
internal SpellQueue(string name, IHUDTheme theme, Player player) : base(name, new Actor(new DummyAnimation(name, (int)HUD.barSize.X, (int)HUD.barSize.Y))) { ZOrder = 100; this.theme = theme; background = new Texture2D(This.Game.GraphicsDevice, 1, 1); background.SetData(new Color[] { theme.TransparentBackgroundColor }); this.player = player; }
internal HUD(IHUDTheme theme) { this.theme = theme; }