Fupixel.SetPixel C# (CSharp) Method

SetPixel() public method

public SetPixel ( float x, float y, Color color ) : void
x float
y float
color Color
return void
    public void SetPixel(float x, float y, Color color)
    {
        pixels[(int)y * width + (int)x] = (Color32)color;
    }

Same methods

Fupixel::SetPixel ( int index, Color color ) : void
Fupixel::SetPixel ( int index, Color32 color ) : void
Fupixel::SetPixel ( int index, byte r, byte g, byte b, byte a ) : void
Fupixel::SetPixel ( int index, float r, float g, float b ) : void
Fupixel::SetPixel ( int index, float r, float g, float b, float a ) : void
Fupixel::SetPixel ( int x, int y, Color color ) : void
Fupixel::SetPixel ( int x, int y, Color32 color ) : void
Fupixel::SetPixel ( int x, int y, byte r, byte g, byte b, byte a ) : void
Fupixel::SetPixel ( int x, int y, float r, float g, float b ) : void
Fupixel::SetPixel ( int x, int y, float r, float g, float b, float a ) : void

Usage Example

Esempio n. 1
0
    void Update()
    {
        fupixel.ClearPixels(Color.black);

        for (int i = 0; i < stars.Length; i++)
        {
            int  x = (int)(stars[i].x / stars[i].z) + fupixel.width / 2;
            int  y = (int)(stars[i].y / stars[i].z) + fupixel.height / 2;
            byte c = (byte)(255f / stars[i].z);

            if (x < fupixel.width)
            {
                stars[i] += new Vector3(Time.deltaTime * speed, 0f, 0f);
            }
            else
            {
                stars[i] = new Vector3(-xSize, stars[i].y, stars[i].z);
            }

            if (x >= 0 && x < fupixel.width && y >= 0 && y < fupixel.height)
            {
                fupixel.SetPixel(x, y, c, c, c, 255);
            }
        }
    }
All Usage Examples Of Fupixel::SetPixel