Sign in to follow this  

GUI Drawing

This topic is 3627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello guys! I'm making a GUI in my 3d engine using directx, how can i draw gui?? i was thinking about using sprites, but is there a way to stretch them???(or to stretch a texture?? Thanks... :)

Share this post


Link to post
Share on other sites
Yes, you can use D3DX Sprites for this job - but you should appreciate that they are a quick and simple approach and you may quickly find that they don't cater for all your requirements.

The more traditional (and more complex) approach is to use pre-transformed and pre-lit geometry (D3DFVF_XYZRHW or POSITIONT declarations) where you can specify pixel coordinates for your UI elements.

By virtue of going with screens-space coordinates you start to tie your geometry to a particular resolution. A more robust way is to design relative coordinates in projection space (-1..+1) which not only gives you resolution independence but also re-enables the transform stage in the pipeline.

Texture scaling is handled the same as normal rendering, so no worries there. You may need to be clever to handle the 3x3 grid approach if you don't want distortion.

hth
Jack

Share this post


Link to post
Share on other sites

This topic is 3627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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