dugasz1 Posted September 15, 2016 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? Sorry for lot of questions and thanks for the answers!
Dealman Posted September 15, 2016 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 If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
dugasz1 Posted September 15, 2016 Author 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 . Sorry for lot of questions and thanks for the answers!
Dealman Posted September 15, 2016 Posted September 15, 2016 Yup, the wonders of render targets It should be far more optimized as well If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
dugasz1 Posted September 15, 2016 Author 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 Sorry for lot of questions and thanks for the answers!
dugasz1 Posted September 18, 2016 Author 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 Sorry for lot of questions and thanks for the answers!
Captain Cody Posted September 18, 2016 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)
dugasz1 Posted September 18, 2016 Author 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. Sorry for lot of questions and thanks for the answers!
</Mr.Tn6eL> Posted September 18, 2016 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 skype : 011101000110111000110110011001010110110000110000001110010011000000111001
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