2017-03-17 4 views
0

monogame에 문제가 있습니다. 현재 내가 이렇게 같은 해상도 읽기 :이xna/monogame에 대한 windows 10 재조정 해제

public Game1() 
    { 
     graphics = new GraphicsDeviceManager(this); 
     Content.RootDirectory = "Content"; 
     gameState = new GameState(All_Textures, AllSpritefontTexts, oldState, oldMouse); //All textures have a key, with as return: texture, starting point, clickarea 
    } 

    protected override void Initialize() 
    { 
     base.Initialize(); 
     oldState = Keyboard.GetState(); 
     oldMouse = Mouse.GetState(); 
     IsMouseVisible = true; //You can see the cursor 
     //graphics.IsFullScreen = true;                //DISABLED FOR DEVELOPING REASONS 
     graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height; //Set xna resolution height to curr screen resolution 
     graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; //Set xna resolution width to curr screen resolution 
     graphics.ApplyChanges(); 
    } 

내 프로젝트에 대한 작업을 계속, 그리고 최근에 다른 컴퓨터에서 내 게임을 테스트하기 시작했다. 많은 컴퓨터는 이미지에서 보듯이 10 배의 확대율을 가지고 있습니다. image

이렇게하면 내 monogame 이미지와 spritefonts가 잘못 생성되어 서로 겹치기 때문에 생성 된 hitbox는 발생하지 않습니다. 내 질문은 '어떻게 monogame에서 programatically이 배율을 해제 할 수 있습니까?' 당신이 내 질문에 대답하기 전에보고 더 많은 코드가 필요한 경우

, 내 전체 응용 프로그램이 여기 https://github.com/FireStormHR/SeriousGaming

답변

0

발견되는 문제는 것이 아니라, 화면의 크기에 해상도를 설정하려고하는 것입니다 귀하의 뷰포트. 기본 렌더링 대상의 해상도가 뷰포트보다 크면 제대로 렌더링되지 않습니다. 뷰포트는 화면보다 클 수 없습니다. 너비와 높이에 대해 GraphicsDevice.Viewport.Width 및 GraphicsDevice.Viewport.Height를 사용하면 원하는 결과를 얻을 수 있습니다.