XNA how to draw simple graphics?

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.

+3
source share
5

, ,
-, XNA.
www.riemers.net. XNA.

+1
+1

XNA Platformer Starter Kit, XNA 3.1. , .

, XNA Creators Club , 2D-, . Sprite.

0

, , . , .

0

XNA Debug Terminal - . , , , , , # - , . Visual Studio, . http://www.protohacks.net/xna_debug_terminal. XNA.

0

Source: https://habr.com/ru/post/1718637/


All Articles