Documentation
    Preparing search index...

    Function layerMask

    • Compiles layer names to the mask that contains exactly them (§46).

      node.layers = layerMask("ui");                  // one layer
      view.layerMask = layerMask("default", "debug"); // two
      layerMask() === NO_LAYERS; // none

      Undefined names are defined on the way through, by defineLayer: layerMask("ui") is the shortest correct spelling of "put this on the UI layer" and requiring a separate declaration first would make the common case two statements for no safety — a name is checked by the same mechanism either way, and a typo that allocates a bit is loud (the layer is empty, and layerNames shows it) rather than silent. Call layerIndex when you need a lookup that cannot allocate.

      Parameters

      • ...layerNamesToSet: readonly string[]

      Returns number

      FourError INVALID_APPLICATION_STATE — see defineLayer.