public override void Render() { if (alpha > 0f) { Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * alpha * 0.6f); } base.Render(); if (Lines == null) { return; } ActiveFont.DrawEdgeOutline(Title, new Vector2(960f, 128f), new Vector2(0.5f, 0.5f), Vector2.One * 2f, Color.Gray * alpha, 4f, Color.DarkSlateBlue * alpha, 2f, Color.Black * (alpha * alpha * alpha)); Draw.Rect(64f, 128f + 64f + 2f, 1920f - 2f * 64f, 4f, Color.Black * alpha * 0.8f); if (ProgressMax > 0) { Draw.Rect(64f, 128f + 64f, (Progress / (float)ProgressMax) * (1920f - 2f * 64f), 8f, Color.White * alpha * 0.8f); } else { // TODO: Indeterminate progress bar! } Rectangle log = new Rectangle(1920 / 2 - logBounds.Width / 2, 128 + 64 + 16, logBounds.Width, logBounds.Height); Draw.Rect(log, Color.Black * alpha * 0.8f); if (logBuffer != null) { Draw.SpriteBatch.Draw(logBuffer.Target, log, Color.White * alpha); } }
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); } }
public void CreateDeleteBackupsOlderThanDaysEntry(TextMenu textMenu, bool inGame) { BetterIntSlider item = new BetterIntSlider(DialogId.Options.DeleteBackupsOlderThanDays.DialogClean(), i => i == -1 ? DialogId.OptionValues.Disabled.DialogClean() : string.Format(DialogId.OptionValues.Days.DialogGet(), i), -1, 100, DeleteBackupsOlderThanDays); item.Change(value => { // skip 0 days if (value > -1 && value < 1) { item.Index = item.LastDir > 0 ? 1 : -1; value = item.Index; } DeleteBackupsOlderThanDays = value; }); item.ValueWidthFunc = () => { float width = 0; width = Math.Max(width, ActiveFont.Measure(item.ValuesFunc(item.Min)).X); width = Math.Max(width, ActiveFont.Measure(item.ValuesFunc(item.Max)).X); return(width); }; textMenu.Add(item); menuItems.Add(DialogId.Options.DeleteBackupsOlderThanDays, item); }
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); }
public void CreateDeleteBackupsAfterAmountEntry(TextMenu textMenu, bool inGame) { BetterIntSlider item = new BetterIntSlider(DialogId.Options.DeleteBackupsAfterAmount.DialogClean(), i => i == -1 ? DialogId.OptionValues.Disabled.DialogClean() : $"{i}", -1, 500, DeleteBackupsAfterAmount); item.Change(value => { // skip 0 if (value > -1 && value < 1) { item.Index = item.LastDir > 0 ? 1 : -1; value = item.Index; } DeleteBackupsAfterAmount = value; }); item.ValueWidthFunc = () => { float width = 0; width = Math.Max(width, ActiveFont.Measure(item.ValuesFunc(item.Min)).X); width = Math.Max(width, ActiveFont.Measure(item.ValuesFunc(item.Max)).X); return(width); }; textMenu.Add(item); menuItems.Add(DialogId.Options.DeleteBackupsAfterAmount, item); }
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); }
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); } }
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() { Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * Ease.CubeOut(Alpha)); base.Render(); if (remappingEase <= 0.0) { return; } Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * 0.95f * Ease.CubeInOut(remappingEase)); Vector2 position = new Vector2(1920f, 1080f) * 0.5f; if (remappingKeyboard || Input.GuiInputController()) { ActiveFont.Draw( remappingKeyboard ? Dialog.Get(DialogIds.KeyConfigChanging) : Dialog.Get(DialogIds.BtnConfigChanging), position + new Vector2(0.0f, -8f), new Vector2(0.5f, 1f), Vector2.One * 0.7f, Color.LightGray * Ease.CubeIn(remappingEase)); ActiveFont.Draw(ButtonInfos[remappingType].GetLabel(), position + new Vector2(0.0f, 8f), new Vector2(0.5f, 0.0f), Vector2.One * 2f, Color.White * Ease.CubeIn(remappingEase)); } else { ActiveFont.Draw(Dialog.Clean(DialogIds.BtnConfigNoController), position, new Vector2(0.5f, 0.5f), Vector2.One, Color.White * Ease.CubeIn(remappingEase)); } }
public void BeforeRender() { if (!Focused || !Visible || Lines == null) { return; } if (logBuffer == null) { logBuffer = VirtualContent.CreateRenderTarget("loggedprogress-log", logBounds.Width, logBounds.Height); } Engine.Graphics.GraphicsDevice.SetRenderTarget(logBuffer.Target); Engine.Graphics.GraphicsDevice.Clear(Color.Transparent); Draw.SpriteBatch.Begin(); for (int i = 0; i < Lines.Count; i++) { ActiveFont.Draw( Lines[i], new Vector2(8f, logBuffer.Height - 8f - (30f * (Lines.Count - i))), Vector2.Zero, Vector2.One * 0.5f, Color.White ); } Draw.SpriteBatch.End(); }
private void calculateBaseSizes() { // compute the max size of a digit and separators in the English font, for the timer part. PixelFont font = Dialog.Languages["english"].Font; float fontFaceSize = Dialog.Languages["english"].FontFaceSize; PixelFontSize pixelFontSize = font.Get(fontFaceSize); for (int i = 0; i < 10; i++) { float digitWidth = pixelFontSize.Measure(i.ToString()).X; if (digitWidth > numberWidth) { numberWidth = digitWidth; } } spacerWidth = pixelFontSize.Measure('.').X; numberHeight = pixelFontSize.Measure("0:.").Y; // measure the ranks in the font for the current language. rankMeasurements = new Dictionary <string, Vector2>() { { "Gold", ActiveFont.Measure(Dialog.Clean("collabutils2_speedberry_gold") + " ") * targetTimeScale }, { "Silver", ActiveFont.Measure(Dialog.Clean("collabutils2_speedberry_silver") + " ") * targetTimeScale }, { "Bronze", ActiveFont.Measure(Dialog.Clean("collabutils2_speedberry_bronze") + " ") * targetTimeScale } }; }
public override void Render() { if (Scene.Paused) { return; } if (drawText) { Vector2 center = new Vector2(1920f, 1080f) / 2f; float scaleFactor = 1.2f + pulse * 0.2f; Vector2 scaledSize = size * scaleFactor; float ease = Ease.SineInOut(this.ease); Draw.Rect(center.X - (scaledSize.X + 64f) * 0.5f, center.Y - (scaledSize.Y + 32f) * 0.5f * ease, (scaledSize.X + 64f), (scaledSize.Y + 32f) * ease, Color.Black); Vector2 textPosition = center + new Vector2(-scaledSize.X * 0.5f, 0f); Vector2 scale = new Vector2(1f, ease) * scaleFactor; Color textColor = Color.White * ease; ActiveFont.Draw(leftText, textPosition, new Vector2(0f, 0.5f), scale, textColor); ActiveFont.Draw(rightText, textPosition + Vector2.UnitX * (leftSize + numberSize) * scaleFactor, new Vector2(0f, 0.5f), scale, textColor); if (hasCount) { ActiveFont.Draw(((int)Approach).ToString(), textPosition + Vector2.UnitX * (leftSize + numberSize * 0.5f) * scaleFactor, new Vector2(0.5f, 0.5f), scale, textColor); } } }
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); } }
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); } }
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 float Width() { if (forceWidth) { return(width); } return(Math.Max(width, ActiveFont.Measure(text).X *scale)); }
public override void Render() { Vector2 position = ((Level)Scene).Camera.Position; Vector2 value = position + new Vector2(160f, 90f); Vector2 position2 = (Position - position + (Position - value) * 0.2f) * 6f; ActiveFont.Draw(text, position2, new Vector2(0.5f, 0.5f), Vector2.One * 1.25f, Color.White * alpha); }
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(); } }
private void RenderManual() { Draw.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, RasterizerState.CullNone, null, Engine.ScreenMatrix); ActiveFont.Draw("Cancel: Back to Previous Scene", new Vector2(8f, 80f), new Vector2(0f, 0f), Vector2.One * 0.5f, Color.White); Draw.SpriteBatch.End(); }
public override void Render() { int prevIndex = index; // Only "focus" if the input method is a gamepad, not a keyboard. if (!MInput.GamePads[Input.Gamepad].Attached) { index = -1; } // TODO: Rewrite or study and document the following code. // It stems from OuiFileNaming. Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * 0.8f * ease); Vector2 pos = boxtopleft + new Vector2(boxPadding, boxPadding); int letterIndex = 0; foreach (string letter in letters) { for (int i = 0; i < letter.Length; i++) { bool selected = letterIndex == line && i == index && !selectingOptions; Vector2 scale = Vector2.One * (selected ? 1.2f : 1f); Vector2 posLetter = pos + new Vector2(widestLetter, lineHeight) / 2f; if (selected) { posLetter += new Vector2(0f, wiggler.Value) * 8f; } DrawOptionText(letter[i].ToString(), posLetter, new Vector2(0.5f, 0.5f), scale, selected); pos.X += widestLetter; } pos.X = boxtopleft.X + boxPadding; pos.Y += lineHeight + lineSpacing; letterIndex++; } float wiggle = wiggler.Value * 8f; pos.Y = boxtopleft.Y + boxHeight - lineHeight - boxPadding; Draw.Rect(pos.X, pos.Y - boxPadding * 0.5f, boxWidth - boxPadding * 2f, 4f, Color.White); DrawOptionText(cancel, pos + new Vector2(0f, lineHeight + ((selectingOptions && optionsIndex == 0) ? wiggle : 0f)), new Vector2(0f, 1f), Vector2.One * optionsScale, selectingOptions && optionsIndex == 0); pos.X = boxtopleft.X + boxWidth - backspaceWidth - widestLetter - spaceWidth - widestLetter - beginWidth - boxPadding; DrawOptionText(space, pos + new Vector2(0f, lineHeight + ((selectingOptions && optionsIndex == 1) ? wiggle : 0f)), new Vector2(0f, 1f), Vector2.One * optionsScale, selectingOptions && optionsIndex == 1, Value.Length == 0 || !Focused); pos.X += spaceWidth + widestLetter; DrawOptionText(backspace, pos + new Vector2(0f, lineHeight + ((selectingOptions && optionsIndex == 2) ? wiggle : 0f)), new Vector2(0f, 1f), Vector2.One * optionsScale, selectingOptions && optionsIndex == 2, Value.Length <= 0 || !Focused); pos.X += backspaceWidth + widestLetter; DrawOptionText(accept, pos + new Vector2(0f, lineHeight + ((selectingOptions && optionsIndex == 3) ? wiggle : 0f)), new Vector2(0f, 1f), Vector2.One * optionsScale, selectingOptions && optionsIndex == 3, Value.Length < 1 || !Focused); ActiveFont.DrawEdgeOutline(Value, Position + new Vector2(960f, 256f), new Vector2(0.5f, 0.5f), Vector2.One * 2f, Color.Gray, 4f, Color.DarkSlateBlue, 2f, Color.Black); index = prevIndex; }
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; } } } }
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); }
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); } }
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); }
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(); } }
public override void Render() { int prevIndex = index; // Only "focus" if we're not using the keyboard for input if (UseKeyboardInput) { index = -1; } Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * 0.8f * ease); // draw the keyboard Vector2 drawingPosition = keyboardTopLeft + new Vector2(boxPadding, boxPadding); int letterIndex = 0; foreach (string letter in letters) { for (int i = 0; i < letter.Length; i++) { bool selected = letterIndex == line && i == index && !selectingOptions; Vector2 scale = Vector2.One * (selected ? 1.7f : 1.4f); Vector2 posLetter = drawingPosition + new Vector2(widestLetter, lineHeight) / 2f; if (selected) { posLetter += new Vector2(0f, wiggler.Value) * 8f; } DrawOptionText(letter[i].ToString(), posLetter, new Vector2(0.5f, 0.5f), scale, selected); drawingPosition.X += widestLetter; } drawingPosition.X = keyboardTopLeft.X + boxPadding; drawingPosition.Y += lineHeight + lineSpacing * 1.4f; letterIndex++; } float wiggle = wiggler.Value * 8f; // draw the boundary line between keyboard and options drawingPosition.X = boxTopLeft.X + boxPadding; drawingPosition.Y = boxTopLeft.Y + boxHeight - lineHeight - boxPadding; Draw.Rect(drawingPosition.X, drawingPosition.Y - boxPadding * 0.5f, boxWidth - boxPadding * 2f, 4f, Color.White); // draw the 3 options DrawOptionText(cancel, drawingPosition + new Vector2(15f, lineHeight + ((selectingOptions && optionsIndex == 0) ? wiggle : 0f)), new Vector2(0f, 1f), Vector2.One * optionsScale, selectingOptions && optionsIndex == 0, !Focused); drawingPosition.X = boxTopLeft.X + boxWidth - backspaceWidth - widestLetter - widestLetter - acceptWidth - boxPadding; DrawOptionText(backspace, drawingPosition + new Vector2(15f, lineHeight + ((selectingOptions && optionsIndex == 1) ? wiggle : 0f)), new Vector2(0f, 1f), Vector2.One * optionsScale, selectingOptions && optionsIndex == 1, Value.Length <= 0 || !Focused); drawingPosition.X += backspaceWidth + widestLetter; DrawOptionText(accept, drawingPosition + new Vector2(10f, lineHeight + ((selectingOptions && optionsIndex == 2) ? wiggle : 0f)), new Vector2(0f, 1f), Vector2.One * optionsScale, selectingOptions && optionsIndex == 2, Value.Length < 1 || !Focused); // draw the current value ActiveFont.DrawEdgeOutline(Value, Position + new Vector2(960f, 286f), new Vector2(0.5f, 0.5f), Vector2.One * 2f, Color.Gray, 4f, Color.DarkSlateBlue, 2f, Color.Black); index = prevIndex; }
private static void LevelOnRender(On.Celeste.Level.orig_Render orig, Level self) { orig(self); if (!Settings.Enabled) { return; } Draw.SpriteBatch.Begin(); int viewWidth = Engine.ViewWidth; int viewHeight = Engine.ViewHeight; string text = Variable.Parse(DisplayContent); Vector2 size = ActiveFont.Measure(text) * Settings.FontSize; float x; float y; switch (Settings.Position) { case Position.TopLeft: x = Settings.Margin; y = Settings.Margin; break; case Position.TopRight: x = viewWidth - size.X - Settings.Margin - Settings.Padding * 2; y = Settings.Margin; break; case Position.BottomLeft: x = Settings.Margin; y = viewHeight - size.Y - Settings.Margin - Settings.Padding * 2; break; case Position.BottomRight: x = viewWidth - size.X - Settings.Margin - Settings.Padding * 2; y = viewHeight - size.Y - Settings.Margin - Settings.Padding * 2; break; default: throw new ArgumentOutOfRangeException(); } Vector2 rectPosition = new Vector2(x, y); Draw.Rect(rectPosition, size.X + Settings.Padding * 2, size.Y + Settings.Padding * 2, Color.Black * Settings.BackgroundAlpha); Vector2 textPosition = new Vector2(x + Settings.Padding, y + Settings.Padding); Vector2 scale = new Vector2(Settings.FontSize); ActiveFont.Draw(text, textPosition, Vector2.Zero, scale, Color.White * Settings.FontAlpha); Draw.SpriteBatch.End(); }
public void SetDisplayText(string text) { _text = text; _width = ActiveFont.Measure(_text).X + TextPadLeft + TextPadRight; if (DeathTrackerModule.Settings.DisplayVisibility == AfterDeath || DeathTrackerModule.Settings.DisplayVisibility == AfterDeathAndInMenu) { _timer = 3f; } }