PlayerTextDrawAlignment

From SA-MP Wiki

Jump to: navigation, search


PlayerTextDrawAlignment was added in SA-MP 0.3e This feature (player-textdraws) was added in SA-MP 0.3e and will not work in earlier versions!


Description:

Set the text alignment of a player-textdraw.


Parameters:
(playerid, PlayerText:text, alignment)
playeridThe ID of the player whose player-textdraw to set the alignment of.
Text:textThe ID of the player-textdraw to set the alignment of.
alignment1-left 2-centered 3-right


Image:32px-Ambox_warning_orange.png

Note

For alignment 2 (center) the x and y values of TextSize need to be swapped, see notes at PlayerTextDrawTextSize.


Return Values:

This function does not return any specific values.


Example Usage:

new PlayerText:MyTextdraw[MAX_PLAYERS];
 
public OnPlayerConnect(playerid)
{
    MyTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 425.0, "This is an example textdraw");
    PlayerTextDrawAlignment(playerid, MyTextdraw[playerid], 2); // Align the textdraw in the center
    return 1;
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.


Personal tools
Navigation
Toolbox