Windows phone 8 使用的首选后缓冲区高度和宽度交叉点工作不正常

Windows phone 8 使用的首选后缓冲区高度和宽度交叉点工作不正常,windows-phone-8,xna,windows-store-apps,monogame,Windows Phone 8,Xna,Windows Store Apps,Monogame,我想开发一款能够支持各种显示尺寸的游戏, 所以我使用下面的代码来实现多尺度 graphics.PreferredBackBufferHeight = 768; graphics.PreferredBackBufferWidth = 1024; shootrect = new Rectangle( 900,650 , 100, 100); touchrect = new Rectangle(mouse.X, mouse.Y, 0, 0); if (mo

我想开发一款能够支持各种显示尺寸的游戏, 所以我使用下面的代码来实现多尺度

   graphics.PreferredBackBufferHeight = 768;
   graphics.PreferredBackBufferWidth = 1024;
   shootrect = new Rectangle( 900,650  , 100, 100);
   touchrect = new Rectangle(mouse.X, mouse.Y, 0, 0);

         if (mouse.LeftButton == ButtonState.Pressed && !jump && shootrect.Intersects(touchrect))
            {
                jump = true; 
            }
使用这段代码,我试图将鼠标坐标与shootrect相交(shootrect是让玩家跳跃的射击按钮),如果我在该rect相交处触摸正常,但在相同宽度和高度的其他地方触摸正常

当我删除
graphics.PreferredBackBufferHeight=768;

graphics.PreferredBackBufferWidth=1024来自代码交叉点的那些行工作正常,但我的缩放不适合其他大小的屏幕

如果您使用这些幻数创建逻辑,则需要手动缩放逻辑(例如矩形)。我建议创建与屏幕宽度和高度相关的图形。

实际上
graphics.PreferredBackBufferHeight=768;
graphics.PreferredBackBufferWidth=1024由于该矩形交叉点工作正常,如果将屏幕分辨率设置为1024 x768,则工作正常,但分辨率为1980x1020,因此不工作