> For the complete documentation index, see [llms.txt](https://azuriohs-organization.gitbook.io/r-type/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://azuriohs-organization.gitbook.io/r-type/transform-components/z-index.md).

# Z-Index

The ZIndex component controls the rendering order of entities.

It defines how elements are layered on the screen — entities with a higher ZIndex are drawn on top of those with a lower one.

#### Class Overview

```cpp
class ZIndex {
public:
    ZIndex(std::int8_t z);

    float GetZIndex() const;
    void SetZIndex(std::int8_t z);

private:
    float _z;
};
```

### 🏠 Constructor

***

ZIndex(std::int8\_t z)

Creates a new ZIndex component with the given depth value.

```cpp
Components::ZIndex zIndex(2);
```

### 📎 Getter

***

float GetZIndex() const

Returns the current ZIndex value.

```cpp
float z = zIndex.GetZIndex();
```

### ⛓️‍💥 Setter

***

#### void SetZIndex(std::int8\_t z)

Updates the ZIndex value.

```cpp
zIndex.SetZIndex(5);
```
