Jump to content

[R] Dynamic Material Text


AriosJentu

Recommended Posts

Hi all

This is easy resource-system, what creating material text (3D text).

Thanks for example of 3D text for SDraw :)

With this resource you have 2 types of creating text - Without using render event, and with render event.

Funtions:

dxDrawMaterialText(float PosX, float PosY, float PosZ, float Width, float Height, string Text, float Size, mixed Color, font Font, float fRotationX, float fRotationY, float fRotationZ) 

OR

dxDrawMaterialText(float PosX, float PosY, float PosZ, float Width, float Height, string Text, float Size, mixed Color, font Font, float Degrees) 

Arguments:

PosX, PosY, PosZ - World Position of the text

Width, Height - Text Plane size

Text - Text

Size - Text Size on Plane

Color - Text color

Font - Text font (DX Fonts)

fRotationX, fRotationY, fRotationZ - World Rotation

OR

Degrees - World Rotation

Creating without render event

dxDrawText3D(float PosX, float PosY, float PosZ, float Width, float Height, string Text, float Size, element Targer, mixed Colour, font Font, float fRotationX, float fRotationY, float fRotationZ) 

OR

dxDrawText3D(float PosX, float PosY, float PosZ, float Width, float Height, string Text, float Size, element Targer, mixed Color, font Font, float Degrees) 

Arguments:

PosX, PosY, PosZ - World Position of the text

Width, Height - Text Plane size

Text - Text

Size - Text Size on Plane

Targer - Target of text

Color - Text color

Font - Text font (DX Fonts)

fRotationX, fRotationY, fRotationZ - World Rotation

OR

Degrees - World Rotation

Creating with render event

Images:

j5YKdBt.png

RZkXgQp.jpg

Download:

GitHub

Community

Example:

dxDrawMaterialText(0, 0,  12, 500, 50, "Test1", 4, tocolor(255, 0, 0), "default", -1, 0, 1) 
dxDrawMaterialText(0, 0,  18, 500, 50, "Test 2", 4, tocolor(0, 255, 0), "default", 45) 
dxDrawMaterialText(0, 0,  24, 500, 50, "Test3", 4, tocolor(0, 0, 255), "default", 90) 
dxDrawMaterialText(0, 0,  30, 100, 50, "Test of this place", 4, tocolor(255,255,0), "default", 135) 
dxDrawMaterialText(0, 0,  36, 100, 20, "Test5", 4, tocolor(255,0,255), "default", 180) 
dxDrawMaterialText(0, 0,  42, 128, 20, "Test 6", 4, tocolor(0,255,255), "default", 225) 
dxDrawMaterialText(0, 0, 48, 128, 32, "Test7", 4,tocolor(255,255,255), "default", 270) 
dxDrawMaterialText(0, 0, 54, 128, 32, "Test 8", 4,tocolor(0,0,0), "default", 315) 
  
  
local xzw, xzh =  guiGetScreenSize() 
local targetz = dxCreateRenderTarget(xzw, xzh,true) 
local targetf = dxCreateRenderTarget(xzw, xzh,true) 
addEventHandler("onClientPreRender", root, function() 
    dxDrawText3D(150, 100, 130, 550, 200, "Place of MTA SA ", 5, targetz, tocolor(102, 0, 255), "pricedown", 150, 99, 0) 
    dxDrawText3D(150, 101, 130, 550, 200, "Place       MTA SA", 5, targetf, tocolor(102, 0, 0), "pricedown", 150, 100, 0) 
end) 

Thanks all

Edited by Guest
Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...