Sign in to follow this  
BingBo

[SOLVED]Resize if passes parent size.

Recommended Posts

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

Share this post


Link to post

Which function are you using? If you are using dxCreateTarget, just do destroy old and make new for resizing.

Share this post


Link to post

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.

Share this post


Link to post

There is no function to change size. You have to do is "destroyElement(yourTarget) then dxCreateTarget(width, height)"

Share this post


Link to post

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.

Share this post


Link to post

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.

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.