Пример #1
0
            public override void Render(Vector2 position, bool highlighted)
            {
                position += Offset;
                float alpha = Container.Alpha * Alpha;

                Color strokeColor = Color.Black * (alpha * alpha * alpha);

                Vector2 textPosition = position + (Container.InnerContent == TextMenu.InnerContentMode.TwoColumn ? new Vector2(0f, 32f) : new Vector2(Container.Width * 0.5f, 32f));
                Vector2 justify      = new Vector2(Container.InnerContent == TextMenu.InnerContentMode.TwoColumn ? 0f : 0.5f, 0.5f);

                DrawIcon(
                    position,
                    Icon,
                    IconWidth,
                    Height(),
                    IconOutline,
                    Color.White * alpha,
                    ref textPosition
                    );

                if (Title.Length < 0)
                {
                    return;
                }

                ActiveFont.DrawOutline(Title, textPosition, justify, Vector2.One * 0.6f, Color.Gray * alpha, 2f, strokeColor);
            }
        public override void Render()
        {
            float textWidth = ActiveFont.Measure(Text).X + 81f;

            Icon.DrawJustified(renderPosition - new Vector2(textWidth / 2f + 15f, 0f), new Vector2(0f, 0.5f));
            ActiveFont.DrawOutline(Text, renderPosition + new Vector2(81f - textWidth / 2f, 0f), new Vector2(0f, 0.5f), Vector2.One, Color, 2f, Color.Black);
        }
Пример #3
0
        public override void Render()
        {
            if (ease > 0f)
            {
                Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * ease * 0.4f);
            }
            base.Render();

            const float spacingX = 48f;
            const float spacingY = 64f;

            Vector2 posCenter = Position + new Vector2(1920f / 2f, 1080f / 2f);
            Vector2 pos;

            // Vector2 posInput = posCenter - new Vector2(spacingX * (digits.Length - 1f) / 2f, spacingY * 0.5f);
            Vector2 posInput = Position + new Vector2(384f, 1080f / 2f);

            pos = posInput;
            for (int i = 0; i < digits.Length; i++)
            {
                DrawOptionText(digits[i].ToString("X1"), pos + new Vector2(0f, wigglerDigits[i].Value * 8f), new Vector2(0f, 0.5f), Vector2.One, selectedDigit == i, i <= 1);
                pos.X += spacingX;
            }

            // pos = posCenter + new Vector2(0f, spacingY * 0.5f + wigglerPath.Value * 2f);
            pos = posInput + new Vector2(spacingX * 2f, spacingY * 0.8f + wigglerPath.Value * 2f);
            ActiveFont.DrawOutline(selectedPath ?? "", pos, new Vector2(0f, 0.5f), Vector2.One * 0.75f, Color.White * ease, 2f, Color.Black * ease * ease * ease);

            pos = posInput + new Vector2(0f, spacingY * -0.8f + wigglerBankPath.Value * 2f);
            ActiveFont.DrawOutline(selectedBankPath ?? "", pos, new Vector2(0f, 0.5f), Vector2.One * 0.75f, Color.LightSlateGray * ease, 2f, Color.Black * ease * ease * ease);

            ActiveFont.DrawEdgeOutline(Dialog.Clean("soundtest_title"), Position + new Vector2(960f, 256f), new Vector2(0.5f, 0.5f), Vector2.One * 2f, Color.Gray, 4f, Color.DarkSlateBlue, 2f, Color.Black);
        }
        private void AreaCompleteDrawHash(On.Celeste.AreaComplete.orig_VersionNumberAndVariants orig, string version, float ease, float alpha)
        {
            orig(version, ease, alpha);

            var settings = this.endingSettings;
            var session  = SaveData.Instance?.CurrentSession;

            if (settings != null)
            {
                var text = settings.Seed;
                if (settings.Rules != Ruleset.Custom)
                {
                    text += " " + settings.Rules.ToString();
                    if (session?.SeedCleanRandom() ?? false)
                    {
                        text += "!";
                    }
                }

                text += "\n#" + settings.Hash;
                text += "\nrando " + this.VersionString;
                var variants = SaveData.Instance?.VariantMode ?? false;
                ActiveFont.DrawOutline(text, new Vector2(1820f + 300f * (1f - Ease.CubeOut(ease)), variants ? 810f : 894f), new Vector2(0.5f, 0f), Vector2.One * 0.5f, settings.SpawnGolden ? Calc.HexToColor("fad768") : Color.White, 2f, Color.Black);
            }
        }
Пример #5
0
        public override void Render()
        {
            if (Everest.Flags.IsDisabled)
            {
                orig_Render();
                return;
            }

            orig_Render();
            if (maplistEase > 0f)
            {
                Vector2 pos = new Vector2(128f * Ease.CubeOut(maplistEase), 1080f - 128f);
                if (journalEnabled)
                {
                    pos.Y -= 128f;
                }
                GFX.Gui["menu/maplist"].DrawCentered(pos, Color.White * Ease.CubeOut(maplistEase));
                (Input.GuiInputController() ? Input.GuiButton(Input.Pause) : Input.GuiButton(Input.ESC)).Draw(pos, Vector2.Zero, Color.White * Ease.CubeOut(maplistEase));
            }

            if (levelsetEase > 0f)
            {
                Vector2 pos  = new Vector2(1920f - 64f * Ease.CubeOut(maplistEase), 1080f - 128f);
                string  line = DialogExt.CleanLevelSet(currentLevelSet);
                ActiveFont.DrawOutline(line, pos, new Vector2(1f, 0.5f), Vector2.One * 0.7f, Color.White * Ease.CubeOut(maplistEase), 2f, Color.Black * Ease.CubeOut(maplistEase));
                Vector2 lineSize = ActiveFont.Measure(line) * 0.7f;
                Input.GuiDirection(new Vector2(0f, -1f)).DrawCentered(pos + new Vector2(-lineSize.X * 0.5f, -lineSize.Y * 0.5f - 16f), Color.White * Ease.CubeOut(maplistEase), 0.5f);
                Input.GuiDirection(new Vector2(0f, +1f)).DrawCentered(pos + new Vector2(-lineSize.X * 0.5f, +lineSize.Y * 0.5f + 16f), Color.White * Ease.CubeOut(maplistEase), 0.5f);
            }
        }
Пример #6
0
            public override void Render(Vector2 position, bool highlighted)
            {
                float alpha       = Container.Alpha;
                Color strokeColor = Color.Black * (alpha * alpha * alpha);

                ActiveFont.DrawOutline(
                    Label, position, new Vector2(0f, 0.5f), Vector2.One,
                    Disabled ? Color.DarkSlateGray : ((highlighted ? Container.HighlightColor : Color.White) * alpha),
                    2f, strokeColor
                    );

                position += new Vector2(Container.Width - RightWidth(), 0f);

                for (int x = -1; x <= 1; x++)
                {
                    for (int y = -1; y <= 1; y++)
                    {
                        if (x != 0 || y != 0)
                        {
                            Language.Icon.DrawJustified(
                                position + new Vector2(x * 2f, y * 2f), new Vector2(0f, 0.5f),
                                strokeColor, 1f
                                );
                        }
                    }
                }

                Language.Icon.DrawJustified(
                    position, new Vector2(0f, 0.5f),
                    Color.White * alpha, 1f
                    );
            }
        public override void Render(Vector2 position, bool highlighted)
        {
            float alpha = Container.Alpha;
            Color color = Disabled
                ? Color.Gray * alpha
                : (highlighted ? Container.HighlightColor : Color.White) * alpha;
            Color strokeColor = Color.Black * (alpha * alpha * alpha);

            Vector2 offset = Vector2.Zero;

            foreach (var label in labels)
            {
                float scale        = 1f;
                float measureWidth = ActiveFont.Measure(label.Key).X;
                if (measureWidth > label.Value - Divider)
                {
                    scale = (label.Value - Divider) / measureWidth;
                }

                ActiveFont.DrawOutline(label.Key, position + offset, new Vector2(0.0f, 0.5f), Vector2.One * scale,
                                       color, 2f,
                                       strokeColor);
                offset += new Vector2(label.Value, 0);
            }
        }
Пример #8
0
            public override void Render(Vector2 position, bool highlighted)
            {
                position += Offset;
                float alpha = Container.Alpha * Alpha;

                Color textColor   = (Disabled ? Color.DarkSlateGray : highlighted ? Container.HighlightColor : Color.White) * alpha;
                Color strokeColor = Color.Black * (alpha * alpha * alpha);

                bool flag = Container.InnerContent == TextMenu.InnerContentMode.TwoColumn && !AlwaysCenter;

                Vector2 textPosition = position + (flag ? Vector2.Zero : new Vector2(Container.Width * 0.5f, 0f));
                Vector2 justify      = flag ? new Vector2(0f, 0.5f) : new Vector2(0.5f, 0.5f);

                DrawIcon(
                    position,
                    Icon,
                    IconWidth,
                    Height(),
                    IconOutline,
                    (Disabled ? Color.DarkSlateGray : highlighted?Color.White: Color.LightSlateGray) * alpha,
                    ref textPosition
                    );

                ActiveFont.DrawOutline(Label, textPosition, justify, Vector2.One, textColor, 2f, strokeColor);
            }
Пример #9
0
        public override void Render()
        {
            base.Render();
            if (fading)
            {
                fadeTime -= Engine.DeltaTime;
                if (fadeTime < 0)
                {
                    CreateTween(0.6f, (t) =>
                    {
                        Position = Vector2.Lerp(OnscreenPos, OffscreenPos, t.Eased);
                    });
                    fading = false;
                }
            }

            //if (!(drawLerp <= 0f) && fadeTime > 0f)
            {
                ActiveFont.DrawOutline(Name, Position - (NameMeasure.X * Vector2.UnitX / 2 * 0.7f), new Vector2(0f, 1f), Vector2.One * 0.7f, Color.White, 2f, Color.Black);
                string txt = TimeSpan.FromTicks(TimeSpent).ShortGameplayFormat();
                DrawTime(Position - (GetTimeWidth(txt) * Vector2.UnitX / 2) + NameMeasure.Y * Vector2.UnitY * 1.2f * 0.7f, txt, TimeSpent > TrackedChallenge.TimeLimit ? Color.Gray : Color.Gold);
                txt = TimeSpan.FromTicks(TrackedChallenge.TimeLimit).ShortGameplayFormat();
                DrawTime(Position - (GetTimeWidth(txt) * Vector2.UnitX / 2 * 0.7f) + NameMeasure.Y * Vector2.UnitY * 1.8f * 0.7f, txt, Color.Gold, 0.7f);
            }
        }
Пример #10
0
 public override void Render()
 {
     ActiveFont.DrawOutline(Presentation.GetCleanDialog("PAGE5_TITLE"), new Vector2(128f, 100f), Vector2.Zero, Vector2.One * 1.5f, Color.White, 2f, Color.Black);
     foreach (Display display in displays)
     {
         display.Render();
     }
 }
Пример #11
0
            public override void Render()
            {
                base.Render();
                if (parent.currentMode != Modes.ENTERSHOP)
                {
                    if (parent == null || GameData.Instance.players[parent.PlayerID] == null)
                    {
                        return;
                    }
                    string strawberryText = ((parent.tempStrawberries == -1) ? GameData.Instance.players[parent.PlayerID].strawberries : parent.tempStrawberries) + "";
                    string heartText      = GameData.Instance.players[parent.PlayerID].hearts + "";
                    if (parent.currentMode == Modes.BUYHEART)
                    {
                        ActiveFont.DrawOutline("-" + GameData.Instance.heartCost, (parent.Position - parent.level.LevelOffset) * 6 + new Vector2(8, 34) * 6 - parent.level.ShakeVector * 6, new Vector2(0.5f, 0.5f), Vector2.One, Color.Red, 2f, Color.Black);
                        ActiveFont.DrawOutline("+1", (parent.Position - parent.level.LevelOffset) * 6 + new Vector2(0x1E, 34) * 6 - parent.level.ShakeVector * 6, new Vector2(0.5f, 0.5f), Vector2.One, Color.LimeGreen, 2f, Color.Black);
                    }
                    else if (parent.currentMode == Modes.BUYITEM)
                    {
                        ActiveFont.DrawOutline("-" + GameData.Instance.itemPrices[parent.itemBeingBought], (parent.Position - parent.level.LevelOffset) * 6 + new Vector2(8, 34) * 6 - parent.level.ShakeVector * 6, new Vector2(0.5f, 0.5f), Vector2.One, Color.Red, 2f, Color.Black);
                        ActiveFont.DrawOutline("+1", (parent.Position - parent.level.LevelOffset) * 6 + new Vector2(0x1E, 34) * 6 - parent.level.ShakeVector * 6, new Vector2(0.5f, 0.5f), Vector2.One, Color.LimeGreen, 2f, Color.Black);
                        heartText = GameData.Instance.players[parent.PlayerID].items.Count((i) => i == parent.itemBeingBought) + "";
                    }
                    else if (parent.currentMode == Modes.BUYARBITRARY)
                    {
                        ActiveFont.DrawOutline("-" + parent.arbitraryCost, (parent.Position - parent.level.LevelOffset) * 6 + new Vector2(8, 34) * 6 - parent.level.ShakeVector * 6, new Vector2(0.5f, 0.5f), Vector2.One, Color.Red, 2f, Color.Black);
                        ActiveFont.DrawOutline("+" + parent.arbitraryPurchaseAmount, (parent.Position - parent.level.LevelOffset) * 6 + new Vector2(0x1E, 34) * 6 - parent.level.ShakeVector * 6, new Vector2(0.5f, 0.5f), Vector2.One, Color.LimeGreen, 2f, Color.Black);
                    }
                    ActiveFont.DrawOutline(strawberryText, (parent.Position - parent.level.LevelOffset) * 6 + new Vector2(8, 26) * 6 - parent.level.ShakeVector * 6, new Vector2(0.5f, 0.5f), Vector2.One, Color.White, 2f, Color.Black);
                    if (parent.currentMode != Modes.BUYARBITRARY)
                    {
                        ActiveFont.DrawOutline(heartText, (parent.Position - parent.level.LevelOffset) * 6 + new Vector2(29.5f, 26) * 6 - parent.level.ShakeVector * 6, new Vector2(0.5f, 0.5f), Vector2.One, Color.White, 2f, Color.Black);
                    }
                }

                // Display items
                for (int i = 0; i < GameData.Instance.players[parent.playerID].items.Count; i++)
                {
                    switch (GameData.Instance.players[parent.playerID].items[i])
                    {
                    case GameData.Item.DOUBLEDICE:
                        parent.doubleDiceTexture.Draw((parent.Position - parent.level.LevelOffset) * 6 + new Vector2(0x0C + i * 0x24, 0x0C) - parent.level.ShakeVector * 6, Vector2.Zero, Color.White, new Vector2(2, 2));
                        break;
                    }
                }
                // Display items in the shop
                if (parent.currentMode == Modes.ENTERSHOP)
                {
                    for (int i = 0; i < GameData.Instance.shopContents.Count; i++)
                    {
                        switch (GameData.Instance.shopContents[i])
                        {
                        case GameData.Item.DOUBLEDICE:
                            parent.doubleDiceTexture.Draw((parent.Position - parent.level.LevelOffset) * 6 + new Vector2(0x12 * 6 + 2 + i * 0x24 - (GameData.Instance.shopContents.Count - 1) * 18, 0x20 * 6) - parent.level.ShakeVector * 6, Vector2.Zero, Color.White, new Vector2(2, 2));
                            break;
                        }
                    }
                }
            }
Пример #12
0
 public override void Render()
 {
     ActiveFont.DrawOutline(Presentation.GetCleanDialog("PAGE4_TITLE"), new Vector2(128f, 100f), Vector2.Zero, Vector2.One * 1.5f, Color.White, 2f, Color.Black);
     tutorial.Render(new Vector2(Width / 2f, Height / 2f - 100f));
     if (list != null)
     {
         list.Draw(new Vector2(160f, Height - 400), new Vector2(0f, 0f), Vector2.One, 1f, 0, listIndex);
     }
 }
Пример #13
0
 private void drawNextRankTimeTopLeft(string nextRankName, Vector2 positionOffset, string rankTimeString, Vector2 rankTimeSize, float fontOffset)
 {
     bg.Draw(new Vector2(Position.X - 392 + rankTimeSize.X + rankMeasurements[nextRankName].X, Y - 32) + positionOffset, Vector2.Zero, Color.White, 0.7f);
     drawTime(new Vector2(Position.X + rankMeasurements[nextRankName].X + 3, Y) + positionOffset,
              rankTimeString, rankColors[nextRankName], targetTimeScale, 1f);
     ActiveFont.DrawOutline(Dialog.Clean($"collabutils2_speedberry_{nextRankName}"),
                            new Vector2(Position.X + 3, Y + fontOffset) + positionOffset,
                            new Vector2(0f, 1f), Vector2.One * targetTimeScale, rankColors[nextRankName], 2f, Color.Black);
 }
Пример #14
0
        private void DrawOptionText(string text, Vector2 at, Vector2 justify, Vector2 scale, bool selected, bool special = false)
        {
            Color color =
                selected ? (Calc.BetweenInterval(timer, 0.1f) ? selectColorA : selectColorB) :
                special ? unselectSpecialColor :
                unselectColor;

            ActiveFont.DrawOutline(text, at, justify, scale, color * ease, 2f, Color.Black * ease * ease * ease);
        }
        public override void Render()
        {
            base.Render();

            AreaComplete.Info(speedrunTimerEase, speedrunTimerChapterString, speedrunTimerFileString, chapterSpeedrunText, version);

            ActiveFont.DrawOutline(Dialog.Clean((Scene as Level).Session.Area.GetSID()),
                                   new Vector2(960f, 900f), new Vector2(0.5f, 0.5f), Vector2.One * 0.5f, Color.White, 2f, Color.Black);
        }
Пример #16
0
        public override void Render()
        {
            if (ease > 0f)
            {
                Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * ease * 0.4f);
            }
            base.Render();

            const float spacingX = 48f;
            const float spacingY = 64f;

            Vector2 posCenter = Position + new Vector2(1920f / 2f, 1080f / 2f);
            Vector2 pos;

            // Vector2 posInput = posCenter - new Vector2(spacingX * (digits.Length - 1f) / 2f, spacingY * 0.5f);
            Vector2 posInput = Position + new Vector2(384f, 1080f / 2f);

            pos = posInput;
            for (int i = 0; i < digits.Length; i++)
            {
                DrawOptionText(digits[i].ToString("X1"), pos + new Vector2(0f, wigglerDigits[i].Value * 8f), new Vector2(0f, 0.5f), Vector2.One, selectedDigit == i && !musicParamMenu.Focused, i <= 1);
                pos.X += spacingX;
            }

            // pos = posCenter + new Vector2(0f, spacingY * 0.5f + wigglerPath.Value * 2f);
            pos = posInput + new Vector2(spacingX * 2f, spacingY * 0.8f + wigglerPath.Value * 2f);
            ActiveFont.DrawOutline(selectedPath ?? "", pos, new Vector2(0f, 0.5f), Vector2.One * 0.75f, Color.White * ease, 2f, Color.Black * ease * ease * ease);

            pos = posInput + new Vector2(0f, spacingY * -0.8f + wigglerBankPath.Value * 2f);
            ActiveFont.DrawOutline(selectedBankPath ?? "", pos, new Vector2(0f, 0.5f), Vector2.One * 0.75f, Color.LightSlateGray * ease, 2f, Color.Black * ease * ease * ease);

            if (musicParamMenu.GetItems().Count > 0)
            {
                // Press...
                pos = posInput + new Vector2(0f, spacingY * 2f + wigglerBankPath.Value * 2f);
                ActiveFont.DrawOutline(Dialog.Clean("SOUNDTEST_AUDIOPARAMS_OPEN_1"), pos, new Vector2(0f, 0.5f), Vector2.One * 0.75f, Color.White * ease, 2f, Color.Black * ease * ease * ease);

                // ... [button image] ...
                pos.X += ActiveFont.Measure(Dialog.Clean("SOUNDTEST_AUDIOPARAMS_OPEN_1")).X * 0.75f + 10f;
                MTexture button = Input.GuiButton(Input.MenuJournal);
                button.DrawJustified(pos, new Vector2(0f, 0.5f), Color.White, 0.75f);
                pos.X += button.Width * 0.75f + 10f;

                // ... to edit Audio Params
                ActiveFont.DrawOutline(Dialog.Clean("SOUNDTEST_AUDIOPARAMS_OPEN_2"), pos, new Vector2(0f, 0.5f), Vector2.One * 0.75f, Color.White * ease, 2f, Color.Black * ease * ease * ease);
            }

            ActiveFont.DrawEdgeOutline(Dialog.Clean("soundtest_title"), Position + new Vector2(960f, 256f), new Vector2(0.5f, 0.5f), Vector2.One * 2f, Color.Gray, 4f, Color.DarkSlateBlue, 2f, Color.Black);

            if (musicParamMenuEase > 0f)
            {
                Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * 0.95f * Ease.CubeInOut(musicParamMenuEase));
                musicParamMenu.Alpha = Ease.CubeInOut(musicParamMenuEase);
                musicParamMenu.Render();
            }
        }
Пример #17
0
            public void Render()
            {
                if (ease <= 0f)
                {
                    return;
                }
                Vector2 scale = Vector2.One * (1f + (1f - Ease.CubeOut(ease))) * 1.5f;

                ActiveFont.DrawOutline(Text, Position + new Vector2(Width / 2f, ActiveFont.LineHeight * 0.5f * 1.5f), new Vector2(0.5f, 0.5f), scale, Color.White, 2f, Color.Black);
            }
Пример #18
0
        public override void Render()
        {
            base.Render();

            if (subText != null)
            {
                Vector2 offset = new Vector2(Ease.CubeInOut(this.GetEase()) * 32f, this.GetWiggler().Value * 8f);
                ActiveFont.DrawOutline(subText, Position + offset + new Vector2(84f, 84f), new Vector2(0f, 0.5f), Vector2.One * 0.6f, Color.OrangeRed, 2f, Color.Black);
            }
        }
Пример #19
0
        public override void Render()
        {
            base.Render();

            if (Alpha <= 0f || string.IsNullOrWhiteSpace(Name))
            {
                return;
            }

            if (!GhostModule.Settings.ShowNames ||
                Tracking == null)
            {
                return;
            }

            Level level = SceneAs <Level>();

            if (level == null /*|| level.FrozenOrPaused || level.RetryPlayerCorpse != null || level.SkippingCutscene*/)
            {
                return;
            }

            if (Camera == null)
            {
                Camera = level.Camera;
            }
            if (Camera == null)
            {
                return;
            }

            Vector2 pos = Tracking.Position;

            pos.Y -= 16f;

            pos -= level.Camera.Position;
            pos *= 6f; // 1920 / 320

            Vector2 size = ActiveFont.Measure(Name);

            pos = pos.Clamp(
                0f + size.X * 0.5f, 0f + size.Y * 1f,
                1920f - size.X * 0.5f, 1080f
                );

            ActiveFont.DrawOutline(
                Name,
                pos,
                new Vector2(0.5f, 1f),
                Vector2.One * 0.5f,
                Color.White * Alpha,
                2f,
                Color.Black * (Alpha * Alpha * Alpha)
                );
        }
Пример #20
0
        /// <summary>
        /// This is the same as the vanilla method, except it calls getUnselectedColor() to get the button color
        /// instead of always picking white.
        /// This way, when we change Highlight to true, the button is highlighted like all the "non-default value" options are.
        /// </summary>
        public override void Render(Vector2 position, bool highlighted)
        {
            float   alpha       = Container.Alpha;
            Color   color       = Disabled ? Color.DarkSlateGray : ((highlighted ? Container.HighlightColor : getUnselectedColor()) * alpha);
            Color   strokeColor = Color.Black * (alpha * alpha * alpha);
            bool    flag        = Container.InnerContent == TextMenu.InnerContentMode.TwoColumn && !AlwaysCenter;
            Vector2 position2   = position + (flag ? Vector2.Zero : new Vector2(Container.Width * 0.5f, 0f));
            Vector2 justify     = (flag && !AlwaysCenter) ? new Vector2(0f, 0.5f) : new Vector2(0.5f, 0.5f);

            ActiveFont.DrawOutline(Label, position2, justify, Vector2.One, color, 2f, strokeColor);
        }
Пример #21
0
        public void Render(Vector2 position, bool currentlySelected, float wigglerOffset)
        {
            Vector2 wigglerShift = Vector2.UnitX * (currentlySelected ? wigglerOffset : 0f);
            Color   color        = selectSlot.SelectionColor(currentlySelected);

            Vector2 leftArrowWigglerShift  = lastDirection <= 0 ? wigglerShift : Vector2.Zero;
            Vector2 rightArrowWigglerShift = lastDirection >= 0 ? wigglerShift : Vector2.Zero;

            ActiveFont.DrawOutline("<", position + leftArrowWigglerShift - arrowOffset, new Vector2(0.5f, 0f), Vector2.One * Scale, color, 2f, Color.Black);
            ActiveFont.DrawOutline(">", position + rightArrowWigglerShift + arrowOffset, new Vector2(0.5f, 0f), Vector2.One * Scale, color, 2f, Color.Black);
        }
Пример #22
0
        private void drawNextRankTimeTopCenter(string nextRankName, Vector2 positionOffset, string rankTimeString, Vector2 rankTimeSize, float fontOffset)
        {
            // draw next best rank time
            Vector2 totalSize = rankTimeSize + rankMeasurements[nextRankName].X * Vector2.UnitX;

            drawTime(new Vector2(Position.X - (totalSize.X / 2) + rankMeasurements[nextRankName].X, Y) + positionOffset,
                     rankTimeString, rankColors[nextRankName], targetTimeScale, 1f);
            ActiveFont.DrawOutline(Dialog.Clean($"collabutils2_speedberry_{nextRankName}"),
                                   new Vector2(Position.X - (totalSize.X / 2), Y + fontOffset) + positionOffset,
                                   new Vector2(0f, 1f), Vector2.One * targetTimeScale, rankColors[nextRankName], 2f, Color.Black);
        }
        /// <summary>
        /// Render function for display object.
        /// </summary>
        public override void Render()
        {
            if (!enabled)
            {
                return;
            }

            Y = Calc.Approach(Y, GetYPos(), 100f * Engine.RawDeltaTime);
            Vector2 basePos = Vector2.Lerp(new Vector2(-width, Y), new Vector2(0, Y), Ease.CubeOut(lerp)).Round();

            bg.Draw(new Vector2(basePos.X + width - bg.Width, basePos.Y));
            heartgem.Draw(new Vector2(basePos.X + 26, basePos.Y - 24), Vector2.Zero, Color.White, new Vector2(0.29f, 0.29f));
            x.Draw(new Vector2(basePos.X + 94, basePos.Y - 15));
            ActiveFont.DrawOutline(text, new Vector2(basePos.X + TEXT_PAD_L, basePos.Y - 23), Vector2.Zero, Vector2.One, Color.White, 2, Color.Black);
        }
Пример #24
0
        public override void Render()
        {
            const float scale = 0.75f;
            float       width = ActiveFont.Measure(text).X;

            width *= scale;
            ActiveFont.DrawOutline(
                text,
                new Vector2((1920f - width) / 2f, 980f),
                new Vector2(0f, 0.5f),
                Vector2.One * scale,
                Color.LightGray,
                2f, Color.Black
                );
        }
Пример #25
0
        public override void Render()
        {
            if (alpha > 0f)
            {
                Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * alpha * 0.4f);
            }

            // Draw the search

            Vector2 value = menu.Position - menu.Justify * new Vector2(menu.Width, menu.Height);
            Vector2 pos   = new Vector2(value.X + searchButton.Width + 30, value.Y + menu.GetYOffsetOf(searchButton) - (searchButton.Height() / 2f * 0.75f));

            ActiveFont.DrawOutline(search, pos, Vector2.Zero, Vector2.One * 0.75f, Color.White * menu.Alpha, 2f, Color.Black * (menu.Alpha * menu.Alpha * menu.Alpha));
            base.Render();
        }
Пример #26
0
        private void RenderKeys()
        {
            if (keys == null && mapData?.Levels != null)
            {
                keys = new List <Vector2>();
                foreach (LevelData levelData in mapData.Levels)
                {
                    Rectangle bounds       = levelData.Bounds;
                    Vector2   basePosition = new Vector2(bounds.X, bounds.Y);
                    IEnumerable <EntityData> keyEntityDatas = levelData.Entities
                                                              .Where(entityData => entityData.Name == "key");
                    foreach (EntityData keyEntityData in keyEntityDatas)
                    {
                        keys.Add((basePosition + keyEntityData.Position) / 8);
                    }
                }
            }

            Draw.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp,
                                   DepthStencilState.None, RasterizerState.CullNone, null, Camera.Matrix * Engine.ScreenMatrix);
            if (keys != null && keys.Count > 0)
            {
                for (int i = 0; i < keys.Count; i++)
                {
                    Draw.HollowRect(keys[i].X - 1f, keys[i].Y - 2f, 3f, 3f, Color.Gold);
                }
            }
            Draw.SpriteBatch.End();

            Draw.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp,
                                   DepthStencilState.None, RasterizerState.CullNone, null, Engine.ScreenMatrix);
            if (MInput.Keyboard.Check(Keys.F1))
            {
                Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * 0.25f);
                if (keys != null && keys.Count > 0)
                {
                    for (int i = 0; i < keys.Count; i++)
                    {
                        ActiveFont.DrawOutline((i + 1).ToString(),
                                               (keys[i] - Camera.Position + Vector2.UnitX) *
                                               Camera.Zoom + new Vector2(960f, 540f), new Vector2(0.5f, 0.5f), Vector2.One * 1f, Color.Gold,
                                               2f, Color.Black);
                    }
                }
            }
            Draw.SpriteBatch.End();
        }
Пример #27
0
        public override void Render(Vector2 position, bool highlighted)
        {
            float alpha       = Container.Alpha;
            Color color       = Color.Gray * alpha;
            Color strokeColor = Color.Black * (alpha * alpha * alpha);

            Vector2 offset = Vector2.Zero;

            foreach (var label in labels)
            {
                ActiveFont.DrawOutline(label.Key, position + offset, new Vector2(0.0f, 0.5f), Vector2.One, color, 2f,
                                       strokeColor);
                ActiveFont.DrawOutline(label.Value, position + offset + ActiveFont.Measure(label.Key).XComp(),
                                       new Vector2(0.0f, 0.5f), Vector2.One, Color.White, 2f, strokeColor);
                offset += new Vector2(FixedWidth / labels.Count, 0);
            }
        }
Пример #28
0
        public override void Render()
        {
            base.Render();

            if (!GhostModule.Settings.Enabled || !GhostModule.Settings.ShowOtherNames ||
                Tracking == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(Name))
            {
                return;
            }

            Level level = SceneAs <Level>();

            if (level == null || level.FrozenOrPaused || level.RetryPlayerCorpse != null || level.SkippingCutscene)
            {
                return;
            }

            if (Camera == null)
            {
                Camera = level.Camera;
            }
            if (Camera == null)
            {
                return;
            }

            Vector2 pos = Tracking.Position;

            pos.Y -= 16f;
            pos    = Camera.CameraToScreen(pos) / Camera.Viewport.Width * 1920f;

            ActiveFont.DrawOutline(
                Name,
                pos,
                new Vector2(0.5f, 1f),
                Vector2.One * 0.5f,
                Color.White * Alpha,
                2f,
                Color.Black * (Alpha * Alpha * Alpha)
                );
        }
Пример #29
0
        public override void Render()
        {
            var basePos = Vector2.Lerp(new Vector2(0 - _width, Y), new Vector2(0, Y), Ease.CubeOut(_lerp)).Round();

            _bg.Draw(new Vector2(_width - _bg.Width + basePos.X, Y));


            if (_width > _bg.Width + basePos.X)
            {
                Draw.Rect(0, Y, _width - _bg.Width + basePos.X, 38f, Color.Black);
            }

            _skull.Draw(new Vector2(basePos.X + 26, Y - 24));
            _x.Draw(new Vector2(basePos.X + 94, Y - 15));

            ActiveFont.DrawOutline(_text, new Vector2(basePos.X + TextPadLeft, Y - 25f), Vector2.Zero, Vector2.One, Color.White, 2f, Color.Black);
        }
        public override void Render()
        {
            base.Render();

            float currentWiggle = wiggler.Value * 8f;

            if (openingEase > 0f)
            {
                float   openingEaseEased = Ease.CubeOut(openingEase);
                Vector2 anchor           = new Vector2(960f, 540f);
                float   lineHeight       = ActiveFont.LineHeight;

                // draw background
                Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * openingEaseEased * 0.9f);

                // draw text
                ActiveFont.Draw(Dialog.Clean("collabutils2_assist_skip_confirm"),
                                position: anchor + new Vector2(
                                    x: 0f,
                                    y: -16f - 64f * (1f - openingEaseEased)),
                                justify: new Vector2(0.5f, 1f),
                                scale: Vector2.One,
                                color: Color.White * openingEaseEased);

                ActiveFont.DrawOutline(Dialog.Clean("collabutils2_assist_skip_confirm_yes"),
                                       position: anchor + new Vector2(
                                           x: ((opened && currentlySelectedOption == 0) ? currentWiggle : 0f) * 1.2f * openingEaseEased,
                                           y: 16f + 64f * (1f - openingEaseEased)),
                                       justify: new Vector2(0.5f, 0f),
                                       scale: Vector2.One * 0.8f,
                                       color: opened ? selectionColor(currentlySelectedOption == 0) : Color.Gray,
                                       stroke: 2f,
                                       strokeColor: Color.Black * openingEaseEased);

                ActiveFont.DrawOutline(Dialog.Clean("collabutils2_assist_skip_confirm_no"),
                                       position: anchor + new Vector2(
                                           x: ((opened && currentlySelectedOption == 1) ? currentWiggle : 0f) * 1.2f * openingEaseEased,
                                           y: 16f + lineHeight + 64f * (1f - openingEaseEased)),
                                       justify: new Vector2(0.5f, 0f),
                                       scale: Vector2.One * 0.8f,
                                       color: opened ? selectionColor(currentlySelectedOption == 1) : Color.Gray,
                                       stroke: 2f,
                                       strokeColor: Color.Black * openingEaseEased);
            }
        }