← Back to Docs
  • index.html
  • Clayground
  • Clayground.World
  • AnchoredMask
  • Clayground 2026.2
  • AnchoredMask QML Type

    Shader-based radial darkness mask that tracks a target Item. More...

    Import Statement: import Clayground.World

    Properties

    Detailed Description

    Renders a warm-to-dark radial falloff around a target (typically the player) via a single fragment shader. Use for dungeon lanterns, horror flashlights, or tutorial attention dimmers.

    Place as a direct child of ClayWorld2d. The mask stays locked to the viewport while the target scrolls freely with the world.

    Example usage:

    import Clayground.World
    
    ClayWorld2d {
        id: theWorld
        // ...
        AnchoredMask {
            world: theWorld
            target: theWorld.player
            innerRadius: 6
            outerRadius: 18
            flicker: 0.15
        }
    }

    See also ClayWorld2d.

    Property Documentation

    color : color

    Warm tint applied in the falloff region between inner and outer.


    darkness : color

    Color applied outside outerRadius.


    enabled : bool

    When false the shader is fully skipped (no GPU cost).


    flicker : real

    Flicker amplitude in 0..1. Set to 0 to disable flicker.


    innerRadius : real

    Fully visible radius around the target, in world units.


    outerRadius : real

    Fully dark radius around the target, in world units.


    target : var

    The Item the mask centers on. Must expose xWu and yWu (e.g. a PhysicsItem).


    world : var

    ClayWorld2d reference used for pixelPerUnit and viewport offsets.