UnityEngine.Texture2D.SetPixels32 C# (CSharp) Method

SetPixels32() public method

Set a block of pixel colors.

public SetPixels32 ( int x, int y, int blockWidth, int blockHeight, Color32 colors, [ miplevel ) : void
x int
y int
blockWidth int
blockHeight int
colors Color32
miplevel [
return void
        public void SetPixels32(int x, int y, int blockWidth, int blockHeight, Color32[] colors, [DefaultValue("0")] int miplevel)
        {
            this.SetBlockOfPixels32(x, y, blockWidth, blockHeight, colors, miplevel);
        }

Same methods

Texture2D::SetPixels32 ( Color32 colors ) : void
Texture2D::SetPixels32 ( Color32 colors, [ miplevel ) : void
Texture2D::SetPixels32 ( int x, int y, int blockWidth, int blockHeight, Color32 colors ) : void

Usage Example

コード例 #1
0
        public void SetPixels(Color[] colors)
        {
            // Fix: updside down.
            var ucs = new UnityEngine.Color32[colors.Length];

            for (int i = 0; i < ucs.Length; i++)
            {
                ucs[i] = colors[i].ToUnityColor();
            }

            texture.SetPixels32(ucs);
        }
All Usage Examples Of UnityEngine.Texture2D::SetPixels32