> 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/scale.md).

# Scale

The Scale component defines how much an entity should be stretched or shrunk on the X and Y axes.

It’s used by the rendering system to resize sprites, models, or any visual element.

#### Class Overview

```cpp
class Scale {
public:
    using ScaleType = std::pair<float, float>;

    Scale(float x = 0.0f, float y = 0.0f);

    float GetX() const;
    float GetY() const;

    void SetX(float x);
    void SetY(float y);
    void Set(float x, float y);

    ScaleType GetScale() const;

private:
    ScaleType _scale;
};
```

### 🏠 Constructor

***

Scale(float x = 0.0f, float y = 0.0f)

Creates a new Scale component with initial x and y scale factors.

```cpp
Components::Scale scale(1.0f, 1.0f);
```

### 💿 Getters

***

float GetX() const

Returns the X scale factor.

```cpp
float scaleX = scale.GetX();
```

float GetY() const

Returns the Y scale factor.

```cpp
float scaleY = scale.GetY();
```

### 🧊 Setters

***

void SetX(float x)

Sets a new X scale factor.

```cpp
scale.SetX(1.5f);
```

void SetY(float y)

Sets a new Y scale factor.

```cpp
scale.SetY(0.8f);
```

void Set(float x, float y)

Sets both X and Y scale factors at once.

```cpp
scale.Set(1.2f, 1.2f);
```
