Jump to content

  • Log In with Google      Sign In   
  • Create Account


How to resize an image according to the size of a sprite in directx or slimdx


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Yash14   Members   -  Reputation: 100

Like
0Likes
Like

Posted 01 October 2011 - 01:43 AM

I want to know that is there any way of resizing our texture to the size of a sprite in slimdx direct3d9 or directx9. That is if my image size is 1024x768 and sprite size is 500x500, how can i resize the image in slimdx to display it fully on the sprite without any cropping.

Sponsor:

#2 L. Spiro   Crossbones+   -  Reputation: 9672

Like
1Likes
Like

Posted 01 October 2011 - 01:50 AM

Make a standard quad or 2-triangle strip with UV coordinates:

[0,0]----[1,0]
  |        |
  |        |
[0,1]----[1,1]


Draw at:

[X,Y]-----------[X+500,Y]
  |                 |
  |                 |
[X,Y+500]----[X+500,Y+500]


L. Spiro
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS