update README with usage details
parent
cd238e9ea5
commit
0999b7da78
37
README.md
37
README.md
|
@ -1,3 +1,38 @@
|
|||
# ResolutionScaler
|
||||
|
||||
A simple script for managing resolution scaling in FNA.
|
||||
A simple script for managing resolution scaling in FNA.
|
||||
|
||||
## Usage
|
||||
|
||||
Call **ResolutionScaler.Init** with your display width and height, and your virtual width and height.
|
||||
|
||||
```cs
|
||||
Resolution.Init(
|
||||
GraphicsDevice.PresentationParameters.BackBufferWidth,
|
||||
GraphicsDevice.PresentationParameters.BackBufferHeight,
|
||||
PLAY_AREA_WIDTH,
|
||||
PLAY_AREA_HEIGHT
|
||||
);
|
||||
```
|
||||
|
||||
Then you can pass **ResolutionScaler.TransformMatrix** to FNA's *SpriteBatch* to properly transform your game's render target.
|
||||
|
||||
```cs
|
||||
SpriteBatch.Begin(
|
||||
SpriteSortMode.Deferred,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
Resolution.TransformMatrix
|
||||
);
|
||||
|
||||
SpriteBatch.Draw(
|
||||
GameRenderTarget,
|
||||
Vector2.Zero,
|
||||
Color.White
|
||||
);
|
||||
|
||||
SpriteBatch.End();
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue