Pular para o conteúdo principal

TextDrawAlignment

Descrição​

Defina o alinhamento do texto em um desenho de texto.

ParameterDescrição
Text:textidO ID do textdraw para definir o alinhamento.
TEXT_DRAW_ALIGN:alignmentTEXT_DRAW_ALIGN_LEFT/TEXT_DRAW_ALIGN_CENTER/TEXT_DRAW_ALIGN_RIGHT

Retornos​

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

Exemplos​

/*
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, 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/TextDrawShowForPlayer) para mostrar as alterações desta função.

Funções Relacionadas​