Difference between revisions of "love.graphics.getStencilTest"

(Created page)
 
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{newin|[[0.10.0]]|100|type=function}}
 
{{newin|[[0.10.0]]|100|type=function}}
Gets whether stencil testing is enabled.
+
Gets the current stencil test configuration.
  
When stencil testing is enabled, the geometry of everything that is drawn will be clipped / stencilled out based on whether it intersects with what has been previously drawn to the [[love.graphics.stencil|stencil buffer.]]
+
When stencil testing is enabled, the geometry of everything that is drawn afterward will be clipped / stencilled out based on a comparison between the arguments of this function and the stencil value of each pixel that the geometry touches. The stencil values of pixels are affected via [[love.graphics.stencil]].
  
Each [[Canvas]] has its own stencil buffer.
+
Each [[Canvas]] has its own per-pixel stencil values.
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
enabled, inverted = love.graphics.getStencilTest( )
+
comparemode, comparevalue = love.graphics.getStencilTest( )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
 
None.
 
None.
{{param|boolean|enable (false)|Whether to enable stencil testing.}}
 
{{param|boolean|invert (false)|Whether to invert the stencil test. If true, the parts of drawn geometry that touch what has been previously drawn to the stencil buffer will be clipped. Otherwise everything else will be clipped.}}
 
 
=== Returns ===
 
=== Returns ===
{{param|boolean|enable|Whether stencil testing is enabled.}}
+
{{param|CompareMode|comparemode|The type of comparison that is made for each pixel. Will be "always" if stencil testing is disabled.}}
{{param|boolean|inverted|Whether the stencil test is inverted or not.}}
+
{{param|number|comparevalue|The value used when comparing with the stencil value of each pixel.}}
Nothing.
+
 
 
== See Also ==
 
== See Also ==
 
* [[parent::love.graphics]]
 
* [[parent::love.graphics]]
Line 23: Line 21:
 
* [[love.graphics.stencil]]
 
* [[love.graphics.stencil]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Gets whether stencil testing is enabled.}}
+
{{#set:Description=Gets the current stencil test configuration.}}
 
{{#set:Sub-Category=State}}
 
{{#set:Sub-Category=State}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.graphics.getStencilTest}}
 
{{i18n|love.graphics.getStencilTest}}

Latest revision as of 04:11, 15 December 2015

Available since LÖVE 0.10.0
This function is not supported in earlier versions.

Gets the current stencil test configuration.

When stencil testing is enabled, the geometry of everything that is drawn afterward will be clipped / stencilled out based on a comparison between the arguments of this function and the stencil value of each pixel that the geometry touches. The stencil values of pixels are affected via love.graphics.stencil.

Each Canvas has its own per-pixel stencil values.

Function

Synopsis

comparemode, comparevalue = love.graphics.getStencilTest( )

Arguments

None.

Returns

CompareMode comparemode
The type of comparison that is made for each pixel. Will be "always" if stencil testing is disabled.
number comparevalue
The value used when comparing with the stencil value of each pixel.

See Also


Other Languages