Ejemplo n.º 1
0
            public MasteryTab(HeroClass cl)
            {
                string text = null;

                switch (cl.Ordinal())
                {
                case HeroClassType.Warrior:
                    text = HeroSubClass.GLADIATOR.Desc + "\\Negative\\Negative" + HeroSubClass.BERSERKER.Desc;
                    break;

                case HeroClassType.Mage:
                    text = HeroSubClass.BATTLEMAGE.Desc + "\\Negative\\Negative" + HeroSubClass.WARLOCK.Desc;
                    break;

                case HeroClassType.Rogue:
                    text = HeroSubClass.FREERUNNER.Desc + "\\Negative\\Negative" + HeroSubClass.ASSASSIN.Desc;
                    break;

                case HeroClassType.Huntress:
                    text = HeroSubClass.SNIPER.Desc + "\\Negative\\Negative" + HeroSubClass.WARDEN.Desc;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                var hl = new Highlighter(text);

                var normal = PixelScene.CreateMultiline(hl.Text, 6);

                normal.MaxWidth = WIDTH - MARGIN * 2;
                normal.Measure();
                normal.X = MARGIN;
                normal.Y = MARGIN;
                Add(normal);

                if (hl.IsHighlighted)
                {
                    normal.Mask = hl.Inverted();

                    var highlighted = PixelScene.CreateMultiline(hl.Text, 6);
                    highlighted.MaxWidth = normal.MaxWidth;
                    highlighted.Measure();
                    highlighted.X = normal.X;
                    highlighted.Y = normal.Y;
                    Add(highlighted);

                    highlighted.Mask = hl.Mask;
                    highlighted.Hardlight(TitleColor);
                }

                Height = normal.Y + normal.Height + MARGIN;
                Width  = normal.X + normal.Width + MARGIN;
            }
Ejemplo n.º 2
0
        public ClassShield(HeroClass cl, StartScene startScene)
        {
            _cl         = cl;
            _startScene = startScene;

            _avatar.Frame(((int)cl.Ordinal()) * WIDTH, 0, WIDTH, HEIGHT);
            _avatar.Scale.Set(SCALE);

            _name.Text(cl.Title());
            _name.Measure();

            _brightness = MinBrightness;
            UpdateBrightness();
        }
Ejemplo n.º 3
0
        public static Image Get(this HeroClass cl)
        {
            switch (cl.Ordinal())
            {
            case HeroClassType.Warrior:
                return(Icons.WARRIOR.Get());

            case HeroClassType.Mage:
                return(Icons.MAGE.Get());

            case HeroClassType.Rogue:
                return(Icons.ROGUE.Get());

            case HeroClassType.Huntress:
                return(Icons.HUNTRESS.Get());

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Ejemplo n.º 4
0
 public Avatar(HeroClass cl)
     : base(Assets.AVATARS)
 {
     Frame(new TextureFilm(texture, WIDTH, HEIGHT).Get(cl.Ordinal()));
 }