lolcatsareawesome Posted July 17, 2013 Share Posted July 17, 2013 Hi there, I want to know if exist a function or a trick to set a rotation to a dx text. That would be nice. Thanks Link to comment
50p Posted July 17, 2013 Share Posted July 17, 2013 You can create render target and draw text on it. Then use dxDrawImage to draw the render target with rotation. Link to comment
lolcatsareawesome Posted July 17, 2013 Author Share Posted July 17, 2013 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
50p Posted July 17, 2013 Share Posted July 17, 2013 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
lolcatsareawesome Posted July 17, 2013 Author Share Posted July 17, 2013 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
50p Posted July 17, 2013 Share Posted July 17, 2013 You're welcome, no problem. Good luck. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now