<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LevelOfDetailComponent/addByScreenArea(to:levels:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation22LevelOfDetailComponentV15addByScreenArea2to6levelsyAA6EntityC_SaySayAHG8entities_Sf03minJ0tGtFZ"
  },
  "title" : "addByScreenArea(to:levels:)"
}
-->

# addByScreenArea(to:levels:)

Adds Level of Detail configuration using screen area-based switching to an entity.

```
static func addByScreenArea(to entity: Entity, levels: [(entities: LevelOfDetailComponent.DetailLevel, minArea: Float)])
```

## Parameters

`levels`

An array of levels, where each level specifies the entities
to display and the minimum projected screen area (0.0-1.0) at which they are visible.

## Discussion

Each level pairs a set of entities with a minimum screen area threshold.
Entities within a level are shown or hidden together. Thresholds must be
in descending order and in the range [0.0, 1.0].

Each entity in the provided levels is added as a child of the entity the component will be added to.
Children not included in any level are unaffected by LOD switching.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)