With this function you can switch on or off the colour channels and the alpha channel for all further drawing. For example, you can use this function to create alpha-channel only surfaces (switch off the RGB writing before using the surface), or to create special effects while drawing to the screen.
The default value for each of the components is true, and can be supplied as either four unique arguments or as a 4 element 1D array with the following elements in it which will be either true (enabled) or false (disabled):
gpu_set_colorwriteenable(red_or_array, [green, blue, alpha]);
Argument | Type | Description |
---|---|---|
red_or_array | Boolean | Enable/disable the red channel, or an array containing all four values |
green | Boolean | OPTIONAL Enable/disable the green channel |
blue | Boolean | OPTIONAL Enable/disable the blue channel |
alpha | Boolean | OPTIONAL Enable/disable the alpha channel |
N/A
var cw = gpu_get_colorwriteenable();
cw[3] = false;
gpu_set_colorwriteenable(cw);
The above code gets the current colour write values and then sets the alpha component to false.