public void FillSurface(BitsyGame.Color color) { if (_surface == null) { _surface = new Color32[_texture.width * _texture.height]; } for (int i = 0; i < _surface.Length; i++) { _surface[i].r = color.r; _surface[i].g = color.g; _surface[i].b = color.b; _surface[i].a = color.a; } _texture.SetPixels32(_surface); }
public void SetPixel(BitsyGame.Color color, int x, int y) { x = x + _margin; //y = BitsyGame.RESOLUTION - y - 1 + _margin; y = (_texture.height - _margin - _margin) - y - 1 + _margin; _color[0].r = color.r; _color[0].g = color.g; _color[0].b = color.b; _color[0].a = color.a; _texture.SetPixels32(x, y, 1, 1, _color); //Color c; //c.r = color.r / 255f; //c.g = color.g / 255f; //c.b = color.b / 255f; //c.a = color.a / 255f; //_texture.SetPixel(x, y, c); }