# How to make a 2D semicircle sprite in Unity?

I followed this answer: https://answers.unity.com/questions/1008644/semi-circle-2d-collider.html and was able to create a semicircle collider:

But is there any way I can just crop the circle sprite to make it a semicircle?

I tried looking for other documentation, but couldn't find any..

• Though this statement may make me look like Captian Obvious, you could always draw a semicircle in an art program, import it to Unity, set it to a Sprite, and use it. That will save you alot of complicated programming (as shown in the answer by @LinkWindcrafter). – The Mattbat999 Nov 7 '17 at 3:48
• @TheMattbat999 Would you be able to change the color and resize without losing resolution if you do that? – logic Nov 7 '17 at 3:50
• Draw the semi circle white, then change the color in the Sprite Renderer on the sprite. Resolution, on the other hand, can be dealt with by setting the inport setting Bilinear to Point (No Filter), though you will need to draw the circle large, or it will look pixilated.w – The Mattbat999 Nov 7 '17 at 3:58

Mmmmm, maybe you could just crop the sprite on an image editor and then import it to unity. Seems like the most reasonable way to do it.

Or maybe you could generate on unity half the sprite with something like this:

    /// <summary>Converts Sprite to Texture2D.</summary>
/// <param name="_sprite">Sprite to copy pixels from.</param>
/// <returns>Texture2D with Sprite's pixels.</returns>
public static Texture2D ToTexture(Sprite _sprite)
{
Texture2D newTexture = new Texture2D((int)_sprite.rect.width, (int)(_sprite.rect.height / 2));

Color[] pixels = _sprite.texture.GetPixels
(
(int)_sprite.textureRect.x,
(int)_sprite.textureRect.y,
(int)_sprite.textureRect.width,
(int)(_sprite.textureRect.height / 2) /// Here you crop the sprite on half
);

newTexture.SetPixels(pixels);
newTexture.Apply();
return newTexture;
}


But that's something you should do once, since it is expensive, and this is applied to a Texture2D, and not a sprite.

unity has a built in sprite editor...

• This answer would be better if it explained how to use the built-in sprite editor to make a semi-circle sprite. – DMGregory Jan 10 at 13:36