@Cookiesliyr1 wrote:
This problem seems simple but i spent more than a few attempts to search and solve this problem with no use and kept delaying it for later, this time i am asking for help maybe someone have an idea.
So i have a target resolution of my game 1024x768 and when i resize the render target to anything bigger everything looks fine, but when i try to resize to anything smaller i get this result where if the width or the height is smaller than the target size the spritebatch crop part of the rendertarget on the screen based on the scale down percentage, watch the video to see the result.
I checked the actual window size, the preferred buffer size, the buffer size, the boundary, they all show the right values, this is the code for resizing
public void SetScreen (bool FullScreen, GraphicsDeviceManager g, int Width , int Height) {
g.IsFullScreen = FullScreen;
g.PreferredBackBufferWidth = Width;
g.PreferredBackBufferHeight = Height;
GameCore.CGC.RTScale = new Vector2( (float)WisG.WisGGF.GetScreenWidth/(float)WisG.WisGGF.GetBaseScreenWidth, (float)WisG.WisGGF.GetScreenHeight/(float)WisG.WisGGF.GetBaseScreenHeight);
MenuComponent.UpdateUniversalScale (GameCore.CGC.RTScale);
}This is the code for spritebatch:-
GraphicsDevice.SetRenderTarget(null);
GraphicsDevice.Clear(Color.Purple);
SB.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone);
SB.Draw(WisGGF.RTSB, WisGGF.RTRF, null, Color.White, 0.0f, Vector2.Zero, WisGGF.RTScale, SpriteEffects.None, 0f);
SB.End();for some reason the scale "WisGGF.RTScale" which is the (Target Resolution / selected resolution) is applied kinda twice once on the window size and once again on the inner screen, the problem resume with or without full screen it is if the spritebatch is applying the scale twice but if that's true then the problem should show when i try to pick up a higher resolution too and the scale would take place outside of the window, but it doesn't, it only happen when i pick smaller size resolution.
i am sorry that i can't write this topic in any cleaner way or easier to read. if you have any thoughts or experienced such a problem share them with me, thanks!
Posts: 1
Participants: 1