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 System;
5using osu.Framework.Graphics.Sprites;
6using osu.Framework.Graphics.Textures;
7
8namespace osu.Framework.Graphics.Shapes
9{
10 /// <summary>
11 /// A simple rectangular box. Can be colored using the <see cref="Drawable.Colour"/> property.
12 /// </summary>
13 public class Box : Sprite
14 {
15 public Box()
16 {
17 base.Texture = Texture.WhitePixel;
18 }
19
20 public override Texture Texture
21 {
22 get => base.Texture;
23 set => throw new InvalidOperationException($"The texture of a {nameof(Box)} cannot be set.");
24 }
25 }
26}