BingBo Posted November 14, 2013 Posted November 14, 2013 (edited) Hi, I have created a GUI system using DX drawing, and I need to know how to resize the "elements" if they pass over the parent size. I heard that you can use render targets and dxDrawImageSection, but I don't understand how to use it. Edited November 15, 2013 by Guest
Cadu12 Posted November 14, 2013 Posted November 14, 2013 Which function are you using? If you are using dxCreateTarget, just do destroy old and make new for resizing.
BingBo Posted November 14, 2013 Author Posted November 14, 2013 I'm creating the render target outside any function, then I set it to that, then I render my code and after that I reset the render target.
Cadu12 Posted November 14, 2013 Posted November 14, 2013 There is no function to change size. You have to do is "destroyElement(yourTarget) then dxCreateTarget(width, height)"
BingBo Posted November 15, 2013 Author Posted November 15, 2013 I think that you didn't understand me, what I'm trying to do is resize the "element" of my custom GUI when it goes over the size of the parent the "element" is created on, like the CEGUI does.
Techial Posted November 15, 2013 Posted November 15, 2013 Just draw everything in the render target, then you can draw the render target; ANY size. (Everything inside will of course get smaller) Anyways what's your resolution? Get the render target to fit on YOUR screen, then you can do size*(screenWidth/yourResolution), size*(screenHeight/yourResolution) and so on.
BingBo Posted November 15, 2013 Author Posted November 15, 2013 A friend helped me to do it with a different way, and it works. Thanks anyway.
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