A game framework written with osu! in mind.
at master 31 lines 960 B 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 osu.Framework.Graphics.Containers; 5 6namespace osu.Framework.Graphics.Effects 7{ 8 /// <summary> 9 /// An effect applied around the edge of the target drawable. 10 /// </summary> 11 public class EdgeEffect : IEffect<Container> 12 { 13 /// <summary> 14 /// The parameters of the edge effect. 15 /// </summary> 16 public EdgeEffectParameters Parameters; 17 18 /// <summary> 19 /// Determines how large a radius is masked away around the corners. Default is 0. 20 /// </summary> 21 public float CornerRadius; 22 23 public Container ApplyTo(Drawable drawable) => 24 new Container 25 { 26 Masking = true, 27 EdgeEffect = Parameters, 28 CornerRadius = CornerRadius, 29 }.Wrap(drawable); 30 } 31}