Downsizing a Texture2D in XNA

1.6k views Asked by At

I would like to downsize a Texture2D object to another Texture2D object in XNA.

The reason is to use the downsized object for pixel based collision detection.

Can this be done?

1

There are 1 answers

0
Ben S On BEST ANSWER

You should take a look at the per-pixel collision tutorial as well as the transformed per-pixel collision tutorial.

Essentially, to do collision detection on a transformed texture (such as a scaled one like you want) you use a transformation matrix. It's not overly difficult and the tutorials give a good example. The tutorial doesn't scale but rotates, but comments are include in the source that show you where and how to do scaled as well.