I have a source image that contains a lot of pictures in a guy’s line at different stages of the animation. I loaded the paint and found that the first person starts from 16 pixels across and 0 down and has a width of 16 pixels and a height of 16 pixels (there is black space on the left side of the image).
So, in my XNA code, I set the source rectangle to 16, 0, 16, 16 and draw it on the screen. However, I just get a black square. If I increase the size of the rectangle, I get part of my image, but it seems that the pixels and texels are not from 1 to 1.
I tried to walk on them, but I can not find anything useful. How to display simple graphics? This is my first attempt at XNA.
Simon
source
share