TextDrawSetPreviewRot

From SA-MP Wiki

Jump to: navigation, search


Description:

Sets the rotation and zoom of a 3D model preview textdraw.


TextDrawSetPreviewRot was added in SA-MP 0.3x This function was added in SA-MP 0.3x and will not work in earlier versions!


Parameters:
(Text:text, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fZoom)
Float:fRotXThe X rotation value.
Float:fRotYThe Y rotation value.
Float:fRotZThe Z rotation value.
Float:fZoomThe zoom value, default value 1.0, smaller values make the camera closer and larger values make the camera further away.


Return Values:

This function does not return any specific values.


Example Usage:

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);
	TextDrawSetPreviewRot(textdraw, -10.0, 0.0, -20.0, 1.0);
	//You still have to use TextDrawShowForAll/TextDrawShowForPlayer to make the textdraw visible.
	return 1;
}
Image:32px-Circle-style-warning.png

Important
Note

The textdraw MUST use the font type TEXT_DRAW_FONT_MODEL_PREVIEW and already have a model set in order for this function to have effect.


Related Functions

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



Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.