> For the complete documentation index, see [llms.txt](https://pahutyakv.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pahutyakv.gitbook.io/docs/mega-extension-pack/sprite-renderer.md).

# Sprite Renderer

#### **Visibility**

* `SetVisibility(bool value)` — Enables/disables SpriteRenderer.&#x20;
* `ToggleVisibility()` — Toggles visibility.&#x20;
* `IsVisibleFrom(Camera camera)` — Checks if visible from a camera.

***

#### **Sprite**

* `SetSprite(Sprite sprite)` — Assigns a sprite.&#x20;
* `GetSprite()` — Returns current sprite.&#x20;
* `IsSpriteNull()` — Checks if sprite is null.&#x20;
* `HasSameSprite(SpriteRenderer other)` — Compares sprite with another.&#x20;
* `ReplaceSpritePreserveSize(Sprite newSprite)` — Replaces sprite keeping current size.

***

#### **Color**

* `SetColor(Color color)` — Sets color.&#x20;
* `GetColor()` — Returns current color.

***

#### **Alpha**

* `SetAlpha(float alpha)` — Sets alpha (0–1).&#x20;
* `GetAlpha()` — Returns alpha (0–1).

***

#### **Size**

* `SetSize(Vector2 size)` — Sets size.&#x20;
* `SetSize(float width, float height)` — Sets size by width/height.&#x20;
* `GetSize()` — Returns size.&#x20;
* `MatchSizeWith(SpriteRenderer other)` — Matches size with another.

***

#### **Bounds & Geometry**

* `GetWorldBounds()` — Returns world-space bounds.&#x20;
* `GetLocalBounds()` — Returns local sprite bounds.&#x20;
* `GetPivot()` — Returns normalized pivot (0–1).&#x20;
* `GetAspectRatio()` — Returns sprite aspect ratio (width/height).

***

#### **Flip**

* `SetFlipX(bool value)` — Sets horizontal flip.&#x20;
* `SetFlipY(bool value)` — Sets vertical flip.&#x20;
* `FlipX()` — Toggles horizontal flip.&#x20;
* `FlipY()` — Toggles vertical flip.&#x20;
