Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

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

4: Adsense

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   

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.

#2 L. Spiro   Members   

25465
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




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.