0
votes

I'm making 2D pixel graphic game and want to use custom Sprite using Texture2D class. So I used code like this:

Sprite.Create(texture, new Rect(0, 0, size, size), new Vector2(0.5f, 0.5f), 32)

But this created sprite has FilterMode "Bilinear". I want to change it to "Point (no filter)". Changing FilterMode in inspector is very easy but I don't know how to change it in runtime. Is there any way to solve this problem?

1

1 Answers

1
votes

You can only change the filter mode of the texture.

texture.filterMode = FilterMode.Point;

Sprite.Create(texture, new Rect(0, 0, size, size), new Vector2(0.5f, 0.5f), 32);