undefined Posted July 28, 2015 Share Posted July 28, 2015 How can i split dx element? local scrX, scrY = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawText("TEST TEXT - 1", 0, -25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", true, false, false, true, false) dxDrawText("TEST TEXT - 2", 0, 25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", true, false, false, true, false) end) Im try with dxSetRenderTarget but i can't. I want to make it. (I make it on ps) Link to comment
GTX Posted July 28, 2015 Share Posted July 28, 2015 What do you mean by split? This? local scrX, scrY = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawText("TEST TEXT - 1", 0, -25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, true, false) dxDrawText("TEST TEXT - 2", 0, 25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, true, false) end) Link to comment
GTX Posted July 28, 2015 Share Posted July 28, 2015 local scrX, scrY = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawText("TEST TEXT - 1", 0, -25, 100, -25, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, true, false) dxDrawText("TEST TEXT - 2", 0, 25, 100, 25, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, true, false) end) Link to comment
undefined Posted July 28, 2015 Author Share Posted July 28, 2015 This image and code are only example. I want to cut my other text with function (not dxDrawText arguements). Because dxDrawText clip arguement is work bad in my script . Link to comment
GTX Posted July 28, 2015 Share Posted July 28, 2015 (edited) To clip text correctly: You must calculate the width and height of DX text like: X (of DX text) + Your desired width and Y (of DX text) + Your desired height An example would be. dxDrawText("TEST TEXT - 2", 100, 255, 100+50, 255+40, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", true, false, false, true, false) -- 50 and 40 are my width and height. Edited July 28, 2015 by Guest Link to comment
undefined Posted July 28, 2015 Author Share Posted July 28, 2015 (edited) not dxDrawText arguements Because i use approximate 100 dx text. How can i make with dxSetRenderTarget? When i use dxSetRenderTarget with this code, text is not drawing and not give error or warn Edited July 28, 2015 by Guest Link to comment
GTX Posted July 28, 2015 Share Posted July 28, 2015 Hmm, I see. It's because colorCoded argument was true. This is an example which should clip text a bit on both sides: local scrX, scrY = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawText("TEST TEXT - 1", 100, 255, 100+100, 255+20, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", true, false, false, false, false) end) Link to comment
undefined Posted July 28, 2015 Author Share Posted July 28, 2015 You do not listen to me I want to make it with not using dxDrawText arguements. I want to make it with dxSetRenderTarget. This function cut dx elements. Link to comment
GTX Posted July 28, 2015 Share Posted July 28, 2015 Why do you want to complicate it much more? Anyways: dxCreateRenderTarget dxSetRenderTarget Link to comment
undefined Posted July 28, 2015 Author Share Posted July 28, 2015 I already know these code but i use these code with my code, dx text is not seeing eg local scrX, scrY = guiGetScreenSize() local rtarget = dxCreateRenderTarget(...) addEventHandler("onClientRender", root, function() dxSetRenderTarget(rtarget) dxDrawText("TEST TEXT - 1", 0, -25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", true, false, false, true, false) dxDrawText("TEST TEXT - 2", 0, 25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", true, false, false, true, false) dxSetRenderTarget() end) Dx elements isn't seeing. Link to comment
GTX Posted July 28, 2015 Share Posted July 28, 2015 local scrX, scrY = guiGetScreenSize() local rtarget = dxCreateRenderTarget(400, 400, true) dxSetRenderTarget(rtarget, true) dxDrawText("TEST TEXT - 1", 0, -25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", true, false, false, true, false) dxDrawText("TEST TEXT - 2", 0, 25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", true, false, false, true, false) dxSetRenderTarget() addEventHandler("onClientRender", root, function() dxDrawImage(0, 0, x, y, rtarget) end) 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