Class Stencil
 A SpriteBatch can support many types of stencil effects. Classic
 stencil effects including clipping (limiting drawing to a specific region)
 or masking (prohibiting drawing to a specific region).
 
In particular, stencil effects are designed to support simple constructive area geometry operations. You can union, intersect, or subtract stencil regions to produce the relevant effects. However, this is only used for drawing and does not actually construct the associated geometries.
 To support the CAG operations, the sprite batch stencil buffer has two
 areas: low and high. Operations can be applied to one or both of these
 regions. All binary operations are operations between these two regions.
 For example, Stencil.Effect.CLIP_MASK will restrict all drawing to
 the stencil region defined in the low buffer, while also prohibiting any
 drawing to the stencil region in the high buffer. This has the visible
 effect of "subtracting" the high buffer from the low buffer.
 
 The CAG operations are only supported at the binary level, as we only have
 two halves of the stencil buffer. However, using non-drawing effects like
 Stencil.Effect.CLIP_WIPE or Stencil.Effect.CLIP_CARVE, it is possible to
 produce more interesting nested expressions.
 
 Note that when using split-buffer operations, only one of the operations
 will modify the stencil buffer. That is why there no effects such as
 FILL_WIPE or CLAMP_STAMP.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumAn enum enumerating all of the supported stencil effects.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intBoth buffersstatic final intLower bufferstatic final intNeither stencil effect bufferstatic final intUpper buffer
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidapplyEffect(Stencil.Effect effect) Configures the OpenGL settings to apply the given effect.static voidclearBuffer(int buffer) Clears the stencil buffer specified
- 
Field Details- 
STENCIL_NONEpublic static final int STENCIL_NONENeither stencil effect buffer- See Also:
 
- 
STENCIL_LOWERpublic static final int STENCIL_LOWERLower buffer- See Also:
 
- 
STENCIL_UPPERpublic static final int STENCIL_UPPERUpper buffer- See Also:
 
- 
STENCIL_BOTHpublic static final int STENCIL_BOTHBoth buffers- See Also:
 
 
- 
- 
Constructor Details- 
Stencilpublic Stencil()
 
- 
- 
Method Details- 
clearBufferpublic static void clearBuffer(int buffer) Clears the stencil buffer specified- Parameters:
- buffer- The stencil buffer (lower, upper, both)
 
- 
applyEffectConfigures the OpenGL settings to apply the given effect.- Parameters:
- effect- The stencil effect
 
 
-