CPFlashlightShader
org.cosplay.prefabs.shaders.CPFlashlightShader
class CPFlashlightShader(radius: Int, autoStart: Boolean, skip: (CPZPixel, Int, Int) => Boolean) extends CPShader
Circular flashlight effect shader.
This shader can be used to create a circular flashlight effect around the object. It renders its effect only for a scene object this shader is attached to (i.e. it does not work for entire screen).
Attributes
- autoStart
Whether or not to toggle on the shader effect automatically. Default value is
false
.- radius
Radius of circular flashlight effect.
- skip
Predicate allowing to skip certain pixel from the shader. Predicate takes a pixel (with its Z-order), and X and Y-coordinate of that pixel. Note that XY-coordinates are always in relation to the entire canvas. Typically used to skip background or certain Z-index. Default predicate returns
false
for all pixels.- See also:
- Example:
See CPShaderExample class for the example of using shaders.
- Source:
- CPFlashlightShader.scala
- Graph
- Supertypes