No Revisions Have Been Made To This Page
Can you suggest an edit for this page? Click Here
GML Code Example
|value||Sets the reference value for alpha testing from 0 to 255 (default value is 0)|
This function will set the reference value for the alpha testing
(when it has been enabled using the draw_set_alpha_test). This
is the "cut-off" threshold at which pixels with alpha will not be
Basically, if you have this value set to 0 and you have texture interpolation turned on, you can still get visual errors at the edges of overlapping objects. This is because you can have almost completely transparent areas that block things drawn behind them, but if you set this reference value to, for example, 254 (i.e. one below maximum), this guarantees that only 100% opaque pixels are going to be drawn. You can also turn texture interpolation off, which would normally allow you to use the default values with no problems and no need to use this function at all, however a lot depends on the source artwork.
NOTE: This is an advanced drawing feature, so if you are not sure whether you need it or not, or don't know exactly what it does, you are probably better off not using it as it can seriously corrupt how your game is drawn.