TextDrawAlignment
Description:
Function TextDrawAlignment set the alignment of text in a text draw.
|
Parameters:
(Text:text, alignment)
int | text | The ID of the textdraw to set the alignment of. |
int | alignment | 1 - left, 2 - centered, 3 - right. |
Return Values:
- 1: The function was executed successfully.
- 0: The function failed to execute. This means the textdraw specified does not exist.
Examples:
new Text:MyTextdraw; public OnGameModeInit() { new Text:MyTextdraw = TextDrawCreate(320.0, 425.0, "This is an example textdraw"); TextDrawAlignment(MyTextdraw, 2); // Align the textdraw text 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.
- TextDrawCreate: Create a textdraw.
- TextDrawDestroy: Destroy a textdraw.
- TextDrawColor: Set the color of the text in a textdraw.
- TextDrawBoxColor: Set the color of the box in a textdraw.
- TextDrawBackgroundColor: Set the background color of a textdraw.
- TextDrawFont: Set the font of a textdraw.
- TextDrawLetterSize: Set the letter size of the text in a textdraw.
- TextDrawTextSize: Set the size of a textdraw box.
- TextDrawSetOutline: Choose whether the text has an outline.
- TextDrawSetShadow: Toggle shadows on a textdraw.
- TextDrawSetProportional: Scale the text spacing in a textdraw to a proportional ratio.
- TextDrawUseBox: Toggle if the textdraw has a box or not.
- TextDrawSetString: Set the text in an existing textdraw.