---
title: "TextDrawAlignment | open.mp"
description: "Defina o alinhamento do texto em um desenho de texto."
canonical: https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawAlignment
language: pt-BR
---

# TextDrawAlignment

## Descrição

Defina o alinhamento do texto em um desenho de texto.

| Parameter | Descrição |
| --- | --- |
| Text:textid | O ID do textdraw para definir o alinhamento. |
| TEXT\_DRAW\_ALIGN:alignment | `TEXT_DRAW_ALIGN_LEFT`/`TEXT_DRAW_ALIGN_CENTER`/`TEXT_DRAW_ALIGN_RIGHT` |

## Retornos

Esta função não retorna nenhum valor específico.

## Exemplos

```c
/*
    TEXT_DRAW_ALIGN_LEFT
    TEXT_DRAW_ALIGN_CENTER
    TEXT_DRAW_ALIGN_RIGHT
*/

new Text:gMyTextdraw;

public OnGameModeInit()
{
    gMyTextdraw = TextDrawCreate(320.0, 425.0, "This is an example textdraw");
    TextDrawAlignment(gMyTextdraw, TEXT_DRAW_ALIGN_CENTER); // Alinhe o texto do textdraw no centro
    return 1;
}
```

## Notas

nota

-   Para alinhamento TEXT\_DRAW\_ALIGN\_CENTER (centro), os valores x e y de TextSize precisam ser trocados, consulte as notas em [TextDrawTextSize](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawTextSize), também a coordenada de posição se torna a posição do centro do desenho de texto e não das bordas esquerda/superior.
-   Caso o textdraw já esteja sendo mostrado, ele deve ser mostrado novamente ([TextDrawShowForAll](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawShowForAll)/[TextDrawShowForPlayer](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawShowForPlayer)) para mostrar as alterações desta função.

## Funções Relacionadas

-   [TextDrawCreate](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawCreate): Crie um desenho de texto.
-   [TextDrawDestroy](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawDestroy): Destrua um textdraw.
-   [TextDrawGetAlignment](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawGetAlignment): Obtém o alinhamento do texto de um textdraw.
-   [TextDrawColor](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawColor): Defina a cor do texto em um textdraw.
-   [TextDrawBoxColor](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawBoxColor): Defina a cor da caixa em um textdraw.
-   [TextDrawBackgroundColor](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawBackgroundColor): Defina a cor de fundo de um textdraw.
-   [TextDrawFont](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawFont): Define a fonte de um textdraw.
-   [TextDrawLetterSize](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawLetterSize): Defina o tamanho da letra do texto em um textdraw.
-   [TextDrawTextSize](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawTextSize): Defina o tamanho de uma caixa de desenho de texto.
-   [TextDrawSetOutline](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawSetOutline): Escolha se o texto possui contorno.
-   [TextDrawSetShadow](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawSetShadow): Alterna sombras em um textdraw.
-   [TextDrawSetProportional](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawSetProportional): Dimensione o espaçamento do texto em um textdraw para uma proporção proporcional.
-   [TextDrawUseBox](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawUseBox): Alterna se o textdraw possui caixa ou não.
-   [TextDrawSetString](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawSetString): Defina o texto em um textdraw existente.
-   [TextDrawShowForPlayer](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawShowForPlayer): Mostra um textdraw para um determinado jogador.
-   [TextDrawHideForPlayer](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawHideForPlayer): Oculta um textdraw para um determinado jogador.
-   [TextDrawShowForAll](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawShowForAll): Mostra um textdraw para todos os jogadores.
-   [TextDrawHideForAll](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/TextDrawHideForAll): Oculta um textdraw para todos os jogadores.
