Difference between revisions of "love.graphics.setStencilMode"

m
m (Blanked the page)
(Tag: Blanking)
 
Line 1: Line 1:
{{newin|[[12.0]]|120|type=function|text=This function replaces [[love.graphics.stencil]] and [[love.graphics.setStencilTest]]}}
 
Configures or disables using the screen's per-pixel stencil buffer.
 
  
 
The geometry drawn after configuring the stencil mode can set invisible stencil values of pixels, in addition to affecting pixel colors.
 
 
The stencil buffer (which contains those stencil values) can act like a mask / stencil - this function can be used to determine how further rendering is affected by the stencil values in each pixel, via the '''comparemode''' parameter.
 
 
 
Note that this function does '''not''' prevent subsequent draws from affecting pixel colors, unless [[love.graphics.setColorMask]] is used.
 
== Function ==
 
=== Synopsis ===
 
<source lang="lua">
 
love.graphics.setStencilMode( action, comparemode, value, readmask, writemask )
 
</source>
 
=== Arguments ===
 
{{param|StencilAction|action|Whether and how to modify any stencil values of pixels that are touched by subsequent draws.}}
 
{{param|CompareMode|comparemode|The type of comparison (if any) to make for each pixel.}}
 
{{param|number|value (0)|The value to use when comparing with the stencil value of each pixel, and the new stencil value to use for pixels if the "replace" stencil action is used. Must be an integer between 0 and 255.}}
 
{{param|number|readmask (255)|An 8 bit mask applied to values read from the stencil buffer in subsequent draws.}}
 
{{param|number|writemask (255)|An 8 bit mask applied to values written to the stencil buffer in subsequent draws.}}
 
=== Returns ===
 
Nothing.
 
 
== Function ==
 
Disables writing to the stencil buffer and using its values, for subsequent draws.
 
=== Synopsis ===
 
<source lang="lua">
 
love.graphics.setStencilMode( )
 
</source>
 
=== Arguments ===
 
None.
 
=== Returns ===
 
Nothing.
 
 
== See Also ==
 
* [[parent::love.graphics]]
 
* [[love.graphics.getStencilMode]]
 
* [[love.graphics.setCanvas]]
 
 
[[Category:Functions]]
 
{{#set:Description=Configures or disables using the screen's per-pixel stencil buffer.}}
 
{{#set:Sub-Category=State}}
 
== Other Languages ==
 
{{i18n|love.graphics.setStencilMode}}
 

Latest revision as of 20:59, 27 June 2024