---
title: "PlayerTextDrawAlignment | open.mp"
description: "تنظیم تراز متن یک player-textdraw"
canonical: https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawAlignment
language: fa
---

# PlayerTextDrawAlignment

## توضیحات

تراز متن یک player-textdraw رو تنظیم می‌کنه.

| نام | توضیحات |
| --- | --- |
| playerid | آی‌دی بازیکنی که player-textdraw متعلق بهش هست. |
| PlayerText:textid | آی‌دی player-textdraw که می‌خوای ترازش رو تنظیم کنی. |
| TEXT\_DRAW\_ALIGN:alignment | `TEXT_DRAW_ALIGN_LEFT` / `TEXT_DRAW_ALIGN_CENTER` / `TEXT_DRAW_ALIGN_RIGHT` |

## مقادیر بازگشتی

این تابع هیچ مقدار خاصی برنمی‌گردونه.

## مثال‌ها

```c
/*
    TEXT_DRAW_ALIGN_LEFT
    TEXT_DRAW_ALIGN_CENTER
    TEXT_DRAW_ALIGN_RIGHT
*/

new PlayerText:gMyTextdraw[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    gMyTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 425.0, "This is an example textdraw");
    PlayerTextDrawAlignment(playerid, gMyTextdraw[playerid], TEXT_DRAW_ALIGN_CENTER); // Textdraw ro dar vasat taraz mikonim
    return 1;
}
```

## نکات

یادداشت

-   برای تراز 2 (TEXT\_DRAW\_ALIGN\_CENTER) مقادیر x و y در TextSize باید جابجا بشن، نکات [PlayerTextDrawTextSize](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawTextSize) رو ببین.
-   اگه textdraw از قبل برای بازیکن نمایش داده می‌شه، باید دوباره نمایش داده بشه ([PlayerTextDrawShow](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawShow)) تا تغییرات این تابع اعمال بشن.

## توابع مرتبط

-   [CreatePlayerTextDraw](https://omp.itsneufox.com/fa/docs/scripting/functions/CreatePlayerTextDraw): ایجاد یک player-textdraw.
-   [PlayerTextDrawDestroy](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawDestroy): حذف یک player-textdraw.
-   [PlayerTextDrawGetAlignment](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawGetAlignment): دریافت تراز متن یک player-textdraw.
-   [PlayerTextDrawColor](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawColor): تنظیم رنگ متن در یک player-textdraw.
-   [PlayerTextDrawBoxColor](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawBoxColor): تنظیم رنگ جعبه یک player-textdraw.
-   [PlayerTextDrawBackgroundColor](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawBackgroundColor): تنظیم رنگ پس زمینه یک player-textdraw.
-   [PlayerTextDrawFont](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawFont): تنظیم فونت یک player-textdraw.
-   [PlayerTextDrawLetterSize](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawLetterSize): تنظیم اندازه حروف متن در یک player-textdraw.
-   [PlayerTextDrawTextSize](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawTextSize): تنظیم اندازه جعبه player-textdraw (یا منطقه قابل کلیک برای PlayerTextDrawSetSelectable).
-   [PlayerTextDrawSetOutline](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawSetOutline): فعال/غیرفعال کردن outline روی یک player-textdraw.
-   [PlayerTextDrawSetShadow](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawSetShadow): تنظیم سایه روی یک player-textdraw.
-   [PlayerTextDrawSetProportional](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawSetProportional): تنظیم فاصله متن در یک player-textdraw به نسبت متناسب.
-   [PlayerTextDrawUseBox](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawUseBox): فعال/غیرفعال کردن جعبه روی یک player-textdraw.
-   [PlayerTextDrawSetString](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawSetString): تنظیم متن یک player-textdraw.
-   [PlayerTextDrawShow](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawShow): نمایش یک player-textdraw.
-   [PlayerTextDrawHide](https://omp.itsneufox.com/fa/docs/scripting/functions/PlayerTextDrawHide): مخفی کردن یک player-textdraw.
