A game framework written with osu! in mind.
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 osu.Framework.Graphics.Primitives;
5using osu.Framework.Graphics.Shapes;
6using System;
7
8namespace osu.Framework.Graphics.Visualisation
9{
10 internal class FlashyBox : Box
11 {
12 private Drawable target;
13 private readonly Func<Drawable, Quad> getScreenSpaceQuad;
14
15 public FlashyBox(Func<Drawable, Quad> getScreenSpaceQuad)
16 {
17 this.getScreenSpaceQuad = getScreenSpaceQuad;
18 }
19
20 public Drawable Target
21 {
22 set => target = value;
23 }
24
25 public override Quad ScreenSpaceDrawQuad => target == null ? new Quad() : getScreenSpaceQuad(target);
26 }
27}