gpu_set_colorwriteenable


Description

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):


Syntax:

gpu_set_colorwriteenable(red, green, blue, alpha);


Arguments:

Argument Description
red Enable/disable the red channel
green Enable/disable the green channel
blue Enable/disable the blue channel
alpha Enable/disable the alpha channel


Returns:

N/A


Example:

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.


Back: GPU Functions
Next: gpu_set_alphatestenable
© Copyright YoYo Games Ltd. 2018 All Rights Reserved