A game framework written with osu! in mind.
at master 43 lines 1.4 kB view raw
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2// See the LICENCE file in the repository root for full licence text. 3 4using Markdig.Syntax; 5using osu.Framework.Allocation; 6using osu.Framework.Graphics.Sprites; 7using osuTK.Graphics; 8 9namespace osu.Framework.Graphics.Containers.Markdown 10{ 11 /// <summary> 12 /// Visualises a message that displays when a <see cref="IMarkdownObject"/> doesn't have a visual implementation. 13 /// </summary> 14 public class NotImplementedMarkdown : CompositeDrawable, IMarkdownTextComponent 15 { 16 private readonly IMarkdownObject markdownObject; 17 18 [Resolved] 19 private IMarkdownTextComponent parentTextComponent { get; set; } 20 21 public NotImplementedMarkdown(IMarkdownObject markdownObject) 22 { 23 this.markdownObject = markdownObject; 24 25 AutoSizeAxes = Axes.Y; 26 } 27 28 [BackgroundDependencyLoader] 29 private void load() 30 { 31 InternalChild = CreateSpriteText(); 32 } 33 34 public SpriteText CreateSpriteText() 35 { 36 var text = parentTextComponent.CreateSpriteText(); 37 text.Colour = new Color4(255, 0, 0, 255); 38 text.Font = text.Font.With(size: 21); 39 text.Text = markdownObject?.GetType() + " Not implemented."; 40 return text; 41 } 42 } 43}