Sign in to follow this  
dugasz1

3D dxDraw

Recommended Posts

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?

Share this post


Link to post

Yes the other important benefit and then i don't need to do the math of transformations :D

Edited by dugasz1

Share this post


Link to post

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 by dugasz1

Share this post


Link to post
    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)

 

Share this post


Link to post

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.

Share this post


Link to post
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

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.