Jump to content

Text


Piorun

Recommended Posts

I guess you meant dxDrawText. You can draw the text in any place. Like race resource, it draws the name of vehicle at the place of pickups.

All you need to do is know your position in 3D (x, y and z) and use getScreenFromWorldPosition to know where to draw the text.

Link to comment

This example will draw "SOME TEXT" at the center of San Andreas (it's the place where haystack resource spawns you, if you didn't know):

addEventHandler( "onClientRender", getRootElement(),
function( )
local x, y = getScreenFromWorldPosition( 0, 0, 3 );
if x then
dxDrawText( "SOME TEXT", x, y ); 
end
end
)

Link to comment
This example will draw "SOME TEXT" at the center of San Andreas (it's the place where haystack resource spawns you, if you didn't know):
addEventHandler( "onClientRender", getRootElement(),
function( )
local x, y = getScreenFromWorldPosition( 0, 0, 3 );
if x then
dxDrawText( "SOME TEXT", x, y ); 
end
end
)

By some reason it doesn't work for me :S

I see nothing while in the position 0, 0, 3 or around.

Link to comment

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...