dugasz1 Posted September 15, 2016 Share Posted September 15, 2016 Hello everybody. I would like to draw in 3D. I use DxDrawMaterialLine3D for it. So i have a background image but i want to write text to it and draw recentagles to it. Is it possible? Can i somehow set the dxDrawText output to my background texture? Link to comment
Dealman Posted September 15, 2016 Share Posted September 15, 2016 You can most definitely draw text in 3D as well, you'll want to check out getScreenFromWorldPosition for that. The same applies for drawing DX shapes such as rectangles. 1 Link to comment
dugasz1 Posted September 15, 2016 Author Share Posted September 15, 2016 Thank you for your answer. It's an opportunity but i realised i was blind I can use DxCreateRenderTarget and DxSetRenderTarget then i can just use all the dxDraws and after all draw it with DxDrawMaterialLine3D . Link to comment
Dealman Posted September 15, 2016 Share Posted September 15, 2016 Yup, the wonders of render targets It should be far more optimized as well Link to comment
dugasz1 Posted September 15, 2016 Author Share Posted September 15, 2016 (edited) Yes the other important benefit and then i don't need to do the math of transformations Edited September 15, 2016 by dugasz1 Link to comment
dugasz1 Posted September 18, 2016 Author Share Posted September 18, 2016 (edited) And another question about rendertargets. How can i make a texture from my rendertarget ? Or is it possible ? because i want to delete my render target just keep the texture and draw it? local renderT = dxCreateRenderTarget(400,400, true) dxSetRenderTarget(renderT) dxDrawText("Hello world", 0,0 200,200) dxDrawRecentagle(0,0,200,200, tocolor(255,255,255,255)) --etc.. dxSetRenderTarget() local createdTexture = --get somehow the texture destroyElement(renderT) dxDrawMaterialLine3D(0, 0, 5, 0, 0, 5-2, createdTexture, 2) --Draw it Edited September 18, 2016 by dugasz1 Link to comment
Captain Cody Posted September 18, 2016 Share Posted September 18, 2016 local renderT = dxCreateRenderTarget(400,400, true) dxSetRenderTarget(renderT) dxDrawText("Hello world", 0,0 200,200) dxDrawRecentagle(0,0,200,200, tocolor(255,255,255,255)) --etc.. dxSetRenderTarget() dxDrawMaterialLine3D(0, 0, 5, 0, 0, 5-2,renderT, 2) --Draw it destroyElement(renderT) Link to comment
dugasz1 Posted September 18, 2016 Author Share Posted September 18, 2016 I know but i wanted to create as texture but know i checked it uses the same part of memory so never mind. Thank you. Link to comment
</Mr.Tn6eL> Posted September 18, 2016 Share Posted September 18, 2016 2 hours ago, CodyL said: local renderT = dxCreateRenderTarget(400,400, true) dxSetRenderTarget(renderT) dxDrawText("Hello world", 0,0 200,200) dxDrawRecentagle(0,0,200,200, tocolor(255,255,255,255)) --etc.. dxSetRenderTarget() dxDrawMaterialLine3D(0, 0, 5, 0, 0, 5-2,renderT, 2) --Draw it destroyElement(renderT) dx drawing functions need to render event, and when you destroyed render you will cause an bug 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