TextDrawSetPreviewVehCol
Description:
Function TextDrawSetPreviewVehCol used if a vehicle model is used in a 3D preview textdraw, this sets the two colour values for that vehicle.
Function TextDrawSetPreviewVehCol was added in 0.3x and will not work in earlier versions! |
The textdraw MUST use the font type TEXT_DRAW_FONT_MODEL_PREVIEW in order for this function to have effect. |
Parameters:
(Text:text, color1, color2)
int | text | The textdraw id that is set to display a 3D vehicle model preview. |
int | color1 | The primary Color ID to set the vehicle to. |
int | color2 | The secondary Color ID to set the vehicle to. |
Return Values:
This function does not return any specific values.
Examples:
new Text:textdraw; public OnGameModeInit() { textdraw = TextDrawCreate(320.0, 240.0, "_"); TextDrawFont(textdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); TextDrawUseBox(textdraw, 1); TextDrawBoxColor(textdraw, 0x000000FF); TextDrawTextSize(textdraw, 40.0, 40.0); TextDrawSetPreviewModel(textdraw, 411); // Display model 411 (Infernus) TextDrawSetPreviewVehCol(textdraw, 6, 6); // Set the Infernus to have colour 6 (Yellow) //You still have to use TextDrawShowForAll/TextDrawShowForPlayer to make the textdraw visible. return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- TextDrawFont: Set the font of a textdraw.
- TextDrawSetPreviewModel: Set the 3D preview model of a textdraw.
- TextDrawSetPreviewRot: Set rotation of a 3D textdraw preview.
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnPlayerClickTextDraw: Called when a player clicks on a textdraw.