I wrote a 2D jump and run engine, resulting in 320x224 (320x240) image. To maintain "pixels" to the old school, I want to scale the resulting image by 2 or 3 or 4, according to the user's resolution
I do not want to measure every phantom, but the resulting image!
Thanks in advance :)
But better method than scaling each phantom (as you The position of each phantom can also be increased) Only the matrix has to pass from SpriteBatch.Beggin , like:
sb.Begin (/ * first three parameters / /, Matrix. Creteskel (4f)); This will give you scaling without modifying all your Draw Calls.
However it is worth noting that, if you use floating point offsets in your game, you will end up with things that are not aligned with pixel borders (either with the method ).
There are two solutions to this: Firstly, there should be a function like this:
Public static vector 2 floor (new vector 2 V) (new vector 2 (returned) mathematics . Floor (vX), (float) monastery. Floor (vy)); } And then whenever you draw a sprite, pass your position through that function. Although this can not work if your sprites use any rotation or offset and then you will come back to modify every single Draw Call.
The "correct" way of doing this, if you want a plain point-level scale of your entire scene, then visualize for a render target in its original shape. And then draw your render target on the screen, scale up (with TextureFilter.Point ).
The function you want to see is GraphicsDevice.SetRenderTarget . Maybe readable. If you are on XNA 4.0 or growing, then.
I can not get a simple XNA sample for this quickly, but the sample uses a render target, which then applies to the blur shader, you completely shader completely You can ignore and just scale up.
Comments
Post a Comment