Jump to content

Give a rotation to a text


Recommended Posts

You can create render target and draw text on it. Then use dxDrawImage to draw the render target with rotation.

Oh ok, say me if I'm on the right way.

addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        myRenderTarget = dxCreateRenderTarget( 100, 80 ) 
    end 
) 
  
local rotation = 90; 
  
addEventHandler( "onClientRender", root, 
    function() 
        if myRenderTarget then 
            dxSetRenderTarget( myRenderTarget ) 
            dxDrawText ( "Hello", 10, 20 ) 
             
            dxDrawImage( 50,  50,  100, 100, myRenderTarget , rotation, 0, 0) 
        end 
    end 
) 

Link to comment

You are on the right way. If you have tested it you should know if it works. I think you have to call dxSetRenderTarget to nil once you finished drawing on it, otherwise you'd draw render target inside of render target. So, before you draw the render target, simply call: dxSetRenderTarget() without any arguments passed to the func.

Link to comment
You are on the right way. If you have tested it you should know if it works. I think you have to call dxSetRenderTarget to nil once you finished drawing on it, otherwise you'd draw render target inside of render target. So, before you draw the render target, simply call: dxSetRenderTarget() without any arguments passed to the func.

Okay, it works perfectly good.

Thanks !

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