Example #1
0
        public override void Draw(UISpriteBatch batch)
        {
            if (!Visible || Opacity == 0)
            {
                return;
            }

            DrawLocalTexture(batch, ShadowImg, null, Vector2.Zero, Vector2.One, Color.Black * 0.5f);
            if (Target != null)
            {
                var effect = LotView.WorldContent.SpriteEffect;
                batch.SetEffect(effect);

                effect.CurrentTechnique = effect.Techniques["StickyEffect"];
                var off = ((Position + Size * Scale / 2) - ContainerSize / 2).X * -0.001f * (Size.Y / 240f);
                effect.Parameters["stickyOffset"].SetValue(off * OffsetMultiplier);
                effect.Parameters["stickyPersp"].SetValue((Size.Y / 240f) * -0.2f);

                DrawLocalTexture(batch, Target,
                                 new Rectangle((int)(-100 * ScaleX), 0, (int)(Target.Width + 200 * ScaleX), Target.Height),
                                 -(BackOffset.ToVector2() + new Vector2(100, 0)), new Vector2(1 / (Scale.X), 1 / (Scale.Y)));
                batch.SetEffect();
            }
            DynamicOverlay.GetChildren().ForEach(x =>
            {
                if (x.Opacity != Opacity)
                {
                    x.Opacity = Opacity;
                }
            });
            DynamicOverlay.Draw(batch);
        }
Example #2
0
        public override void Draw(UISpriteBatch batch)
        {
            var effect = LotView.WorldContent.SpriteEffect;

            _BlendColor = new Color(0f, 1f, 1f, Opacity);


            effect.CurrentTechnique = effect.Techniques["HSVEffect"];
            effect.Parameters["Highlight"].SetValue(Highlight);
            batch.SetEffect(effect);
            base.Draw(batch);

            batch.SetEffect();
            effect.Parameters["Highlight"].SetValue(0f);
        }
Example #3
0
        public override void InternalDraw(UISpriteBatch batch)
        {
            var effect = LotView.WorldContent.SpriteEffect;

            batch.SetEffect(effect);

            effect.CurrentTechnique = effect.Techniques["HSVEffect"];
            effect.Parameters["Highlight"].SetValue(Highlight);
            _BlendColor = Color.White;
            DrawLocalTexture(batch, BackgroundImg, null, new Vector2(), Vector2.One, HSVMod);

            _BlendColor  = Color.White;
            _BlendColor *= Opacity;

            batch.SetEffect();
            effect.Parameters["Highlight"].SetValue(0f);
        }
Example #4
0
        public override void Draw(UISpriteBatch batch)
        {
            HueOff += 0.25f / FSOEnvironment.RefreshRate;
            var color = Color.White * Opacity;

            _BlendColor = Color.White;
            var effect = LotView.WorldContent.SpriteEffect;

            for (int i = 0; i < TotalLevels; i++)
            {
                var source = new Rectangle(0, (i == 0) ? 140 : ((i == TotalLevels - 1) ? 0 : 70), 42, 70);
                if (TotalLevels == 1)
                {
                    source.Y += 70;
                }
                var target = new Vector2(-21, -(35 + 70 * i));

                DrawLocalTexture(batch, BgSlice, source, target, Vector2.One, color);

                batch.SetEffect(effect);

                effect.CurrentTechnique = effect.Techniques["HSVEffect"];
                effect.Parameters["Highlight"].SetValue(0f);

                var hcolor = new Color(HueOff % 1f, 1f, 1f, Opacity * 0.66f);
                if (HAnimFill > i && AnimFill < i + 1 && (Math.Abs(HAnimFill - AnimFill) > 2 / 70f || Math.Abs(HFillSpeed) > 2 / 70f))
                {
                    var s   = source;
                    var t   = target;
                    var pct = (HAnimFill < i + 1) ? (HAnimFill % 1) : 1f;
                    s.Y     += (int)((1 - pct) * 70);
                    t.Y     += (int)((1 - pct) * 70);
                    s.Height = (int)Math.Ceiling(pct * 70);
                    DrawLocalTexture(batch, FillSlice, s, t, Vector2.One, hcolor);
                }
                hcolor = new Color(HueOff % 1f, 1f, 1f, Opacity);
                if (AnimFill > i)
                {
                    var s   = source;
                    var t   = target;
                    var pct = (AnimFill < i + 1) ? (AnimFill % 1) : 1f;
                    s.Y     += (int)((1 - pct) * 70);
                    t.Y     += (int)((1 - pct) * 70);
                    s.Height = (int)Math.Ceiling(pct * 70);
                    DrawLocalTexture(batch, FillSlice, s, t, Vector2.One, hcolor);
                }
                batch.SetEffect();
            }

            batch.SetEffect(effect);
            effect.CurrentTechnique = effect.Techniques["HSVEffect"];
            for (int i = 0; i < TotalLevels; i++)
            {
                if (HighlightIntensity[i] > 0)
                {
                    var hcolor = new Color(HueOff % 1f, 1f, 1f, Opacity * HighlightIntensity[i]);
                    DrawLocalTexture(batch, Highlight, null, new Vector2(0, 0 - i * 70), new Vector2((i == 0) ? 1.16667f : 1f), hcolor, 0, new Vector2(29));
                }
            }
            batch.SetEffect();
        }