DESCRIPTION
Example in C# Function to create text in the screen. By: Hayden Almeida and Thanks to key_value.
// C# in Client script
public static void DrawScaleText(string text, int fonte, float x, float y, float size, int cor_red, int cor_green, int cor_blue, int Alpha, bool centralizado)
{
float xc = x / 1920; // ScreenWidth
float yc = y / 1080; // ScreenHeight
API.SetScriptGfxDrawOrder(3);
API.SetTextScale(size, size);
Function.Call(Hash.SET_TEXT_CENTRE, centralizado); // centralized
API.SetTextColor(cor_red, cor_green, cor_blue, Alpha); // COLOR: R G B Alpha
Function.Call((Hash)0xADA9255D, fonte); // FONTS 0 to 20.
Function.Call(Hash._DISPLAY_TEXT, Function.Call<long>(Hash._CREATE_VAR_STRING, 10, "LITERAL_STRING", text ?? "N/A"), xc, yc);
API.SetScriptGfxDrawOrder(3);
}
Recommended Comments
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.