public void SetBitmap(string DisplayText, Point DisplayAtCentrePoint) { bool flag = 0 == 0; this.CentrePoint = DisplayAtCentrePoint; try { this.LabelText = DisplayText; Bitmap bitmap; if (DisplayText != null && DisplayText.Length > 0) { Font fontName = this.DockSettings.Labels.FontName; Color fontColor = this.DockSettings.Labels.FontColor; Color shadowColor = this.DockSettings.Labels.ShadowColor; bitmap = (Bitmap)FancyText.ImageFromText(DisplayText, fontName, fontColor, shadowColor, this.DockSettings.Labels.ShadowSize, this.DockSettings.Labels.ShadowDarkness); } else { bitmap = new Bitmap(1, 1); } base.SetBitmapManaged(ref bitmap); base.DrawBitmapManaged(bitmap.Width, bitmap.Height, true, DisplayAtCentrePoint.X - bitmap.Width / 2, DisplayAtCentrePoint.Y, false, 0, 0, 0, 0, false, 0); bitmap.Dispose(); } catch (Exception) { } }
public override IEnumerator Routine() { while (titleDisplayed.Length < title.Length) { titleDisplayed += title[titleDisplayed.Length].ToString(); yield return(0.05f); } yield return(PressButton()); Audio.Play("event:/new_content/game/10_farewell/ppt_wavedash_whoosh"); while (clipArtEase < 1f) { clipArtEase = Calc.Approach(clipArtEase, 1f, Engine.DeltaTime); yield return(null); } yield return(0.25f); infoText = FancyText.Parse(Presentation.GetDialog("PAGE3_INFO"), Width - 240, 32, 1f, new Color?(Color.Black * 0.7f), null); yield return(PressButton()); Audio.Play("event:/new_content/game/10_farewell/ppt_its_easy"); easyText = new AreaCompleteTitle(new Vector2(Width / 2f, Height - 150), Presentation.GetCleanDialog("PAGE3_EASY"), 2f, true); yield return(1f); yield break; }
private void MakeFancy_OnClick(object sender, RoutedEventArgs e) { MenuFlyout flyout = new MenuFlyout(); flyout.MenuFlyoutPresenterStyle = (Style)App.Current.Resources["MenuFlyoutPresenterStyle1"]; string toconvert = StringArg.Text; if (string.IsNullOrWhiteSpace(StringArg.Text)) { toconvert = StringArg.PlaceholderText; } FancyText fancy = new FancyText(FancyText.FindFancy(toconvert)); foreach (var value in fancy.ConvertAll(toconvert)) { var item = new MenuFlyoutItem() { Text = value, Style = (Style)Application.Current.Resources["MenuFlyoutItemStyle1"], }; flyout.Items.Add(item); item.Click += Item_Click; } flyout.Items.Add(new MenuFlyoutItem() { Text = toconvert, Style = (Style)Application.Current.Resources["MenuFlyoutItemStyle1"], }); flyout.ShowAt(sender as HyperlinkButton); }
public override IEnumerator Routine() { yield return(0.5f); list = FancyText.Parse(Presentation.GetDialog("PAGE4_LIST"), Width, 32, 1f, new Color?(Color.Black * 0.7f), null); float delay = 0f; while (listIndex < list.Nodes.Count) { if (list.Nodes[listIndex] is FancyText.NewLine) { yield return(PressButton()); } else { delay += 0.008f; if (delay >= 0.016f) { delay -= 0.016f; yield return(0.016f); } } listIndex++; } yield break; }
public Option(string key) { this.Key = key; this.Tag = (int)Tags.HUD; int maxLineWidth = 1828; this.Text = FancyText.Parse(Dialog.Get(this.Key), maxLineWidth, -1); foreach (FancyText.Node node in this.Text.Nodes) { if (!(node is FancyText.Portrait portrait)) { continue; } this.Portrait = GFX.PortraitsSpriteBank.Create(portrait.SpriteId); this.Portrait.Play(portrait.IdleAnimation); this.PortraitSide = (Facings)portrait.Side; this.Textbox = "textbox/" + portrait.Sprite + "_ask"; XmlElement xml = GFX.PortraitsSpriteBank.SpriteData[portrait.SpriteId].Sources[0].XML; if (xml != null) { this.PortraitSize = xml.AttrInt("size", 160); } break; } }
public void Log(FancyText text) { Logs.Insert(0, text); var lines = text.GetLines(); Lines.InsertRange(0, lines); if (Scroll > 0) { Scroll += lines.Count; } }
public static void Log(FancyText text) { if (Minimal) { BasicConsole.Instance.Log(text); } else { TabConsole.Instance.Log(text); } }
public Display(Vector2 position, string text, string tutorial, Vector2 tutorialOffset) { Position = position; Info = FancyText.Parse(text, 896, 8, 1f, new Color?(Color.Black * 0.6f), null); Tutorial = new WallbouncePlayback(tutorial, tutorialOffset); Tutorial.OnRender = delegate() { Draw.Line(-64f, 20f, 64f, 20f, Color.Black); Draw.Line(-64f, 20f, -64f, -60f, Color.Black); }; routine = new Coroutine(Routine(), true); }
public override IEnumerator Routine() { string[] text = Presentation.GetCleanDialog("PAGE2_TITLE").Split(new char[] { '|' }); Vector2 pos = new Vector2(128f, 128f); int num; for (int i = 0; i < text.Length; i = num + 1) { TitleText item = new TitleText(pos, text[i]); title.Add(item); yield return(item.Stamp()); pos.X += item.Width + ActiveFont.Measure(' ').X * 1.5f; item = null; num = i; } text = null; pos = default; yield return(PressButton()); list = FancyText.Parse(Presentation.GetDialog("PAGE2_LIST"), Width, 32, 1f, new Color?(Color.Black * 0.7f), null); float delay = 0f; while (listIndex < list.Nodes.Count) { if (list.Nodes[listIndex] is FancyText.NewLine) { yield return(PressButton()); } else { delay += 0.008f; if (delay >= 0.016f) { delay -= 0.016f; yield return(0.016f); } } listIndex++; } yield return(PressButton()); Audio.Play("event:/new_content/game/10_farewell/ppt_impossible"); while (impossibleEase < 1f) { impossibleEase = Calc.Approach(impossibleEase, 1f, Engine.DeltaTime); yield return(null); } yield break; }
private NonFrozenMiniTextbox(string dialogId, string message = null) : base(dialogId) { RemoveTag(Tags.HUD); AddTag(Tags.Global | TagsExt.SubHUD | Tags.FrozenUpdate | Tags.TransitionUpdate); Add(new IgnoreSaveLoadComponent()); if (message != null) { this.SetFieldValue( typeof(MiniTextbox), "text", FancyText.Parse($"{{portrait {(IsPlayAsBadeline() ? "BADELINE" : "MADELINE")} left normal}}{message}", 1544, 2) ); } }
public void Log(FancyText text) { Console.CursorVisible = false; var top = Math.Max(0, Console.CursorTop); Console.SetCursorPosition(0, top); Console.Write(new string(' ', ConsoleUtils.Width - 1)); Console.SetCursorPosition(0, top); text.SetNext(new FancyText("\n", FancyColor.Reset)); text.PrintNext(GuiApp.ConsoleColors); Console.SetCursorPosition(0, Math.Max(0, top + text.GetLines(ConsoleUtils.Width).Count)); SetCursorPos(); }
public async Task <IActionResult> SecondAction(string value) { try { await _writer.WriteToFile(value); FancyText text = new FancyText() { Text = value }; await _context.FancyTexts.AddAsync(text); _context.SaveChanges(); } catch (Exception ex) { return(StatusCode(500, ex.Message)); } return(Ok(value)); }
public CustomTextVignette(Session session, string text, HiresSnow snow = null) { this.session = session; areaMusic = session.Audio.Music.Event; session.Audio.Music.Event = null; session.Audio.Apply(); sfx = Audio.Play(SFX.music_prologue_intro_vignette); if (snow == null) { fade = 1f; snow = new HiresSnow(); } Add(renderer = new HudRenderer()); Add(this.snow = snow); RendererList.UpdateLists(); this.text = FancyText.Parse(Dialog.Get(text), 960, 8, 0f); textCoroutine = new Coroutine(TextSequence()); }
void RandomizeTextboxText(On.Celeste.Textbox.orig_ctor_string_Language_Func1Array orig, Textbox self, string dialog, Language language, Func <IEnumerator>[] events) { if (InRandomizer && RandoLogic.RandomDialogMappings.ContainsKey(dialog.ToLower())) { DynData <Textbox> selfData = new DynData <Textbox>(self); FancyText.Text origText = FancyText.Parse(Dialog.Get(dialog, language), (int)selfData.Get <float>("maxLineWidth"), selfData.Get <int>("linesPerPage"), 0f, null, language); var origTriggers = new List <FancyText.Trigger>(origText.Nodes.OfType <FancyText.Trigger>()); orig(self, RandoLogic.RandomDialogMappings[dialog.ToLower()], language, events); // Replace triggers from randomized text with triggers from original text int origIndex = 0; for (int i = 0; i < self.Nodes.Count; i++) { if (self.Nodes[i] is FancyText.Trigger trigger) { if (origIndex < origTriggers.Count) { trigger.Index = origTriggers[origIndex].Index; trigger.Label = origTriggers[origIndex].Label; trigger.Silent = origTriggers[origIndex].Silent; origIndex++; } else { // This effectively disables the trigger if we've run out of original triggers trigger.Index = -1; } } } // Add the remaining original triggers on to the end if (origIndex < origTriggers.Count) { self.Nodes.AddRange(origTriggers.GetRange(origIndex, origTriggers.Count - origIndex)); } } else { orig(self, dialog, language, events); } }
public void Log(FancyText text) { text.PrintNext(GuiApp.ConsoleColors); Console.Write("\n"); }
public static void Log(FancyText text) { Lm.Log(text); Pm.DrawLogs(); }