示例#1
0
文件: HUD.cs 项目: nemec/4Realms
        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
        }
示例#2
0
文件: HUD.cs 项目: nemec/4Realms
 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 });
 }
示例#3
0
文件: HUD.cs 项目: nemec/4Realms
 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);
 }
示例#4
0
文件: HUD.cs 项目: nemec/4Realms
            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
            }
示例#5
0
文件: HUD.cs 项目: nemec/4Realms
        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;
        }
示例#6
0
文件: HUD.cs 项目: nemec/4Realms
 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);
 }
示例#7
0
文件: HUD.cs 项目: nemec/4Realms
 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))
 {
 }
示例#8
0
文件: HUD.cs 项目: nemec/4Realms
        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;
        }
示例#9
0
文件: HUD.cs 项目: nemec/4Realms
 internal TextFader(string name, IHUDTheme theme)
     : this(name, theme, 0, 0)
 {
 }
示例#10
0
文件: HUD.cs 项目: nemec/4Realms
 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;
 }
示例#11
0
文件: HUD.cs 项目: nemec/4Realms
            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
            }
示例#12
0
文件: HUD.cs 项目: nemec/4Realms
        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
        }
示例#13
0
文件: HUD.cs 项目: nemec/4Realms
 internal HUD(IHUDTheme theme)
 {
     this.theme = theme;
 }
示例#14
0
文件: HUD.cs 项目: nemec/4Realms
 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))
 {
 }
示例#15
0
文件: HUD.cs 项目: nemec/4Realms
 internal TextFader(string name, IHUDTheme theme)
     : this(name, theme, 0, 0)
 {
 }
示例#16
0
文件: HUD.cs 项目: nemec/4Realms
 internal HUD(IHUDTheme theme)
 {
     this.theme = theme;
 }