locked
How do i set specific minimum res. to my app? RRS feed

  • Question

  • I'm currently creating a game based on 16:9 resolution. (1366x768)

    Of course, it the game was played in 4:3 or 16:10, the layout would be ugly....

    How do I set the minimum requirement for the screen res. to be 16:9?

    I read about WinJS.UI.Viewbox. But, when i tried various res. in simulator, it still 'ugly', some parts still get messed up.

    Saturday, January 18, 2014 1:43 PM

Answers

  • There is no way to force a specific size. The user can choose anything from 500 pixels to the full width of the screen. The app must be able to deal gracefully with this. Using a viewbox to zoom the app's layout to fit is a good tool, but you likely also want to check the window bounds and choose a different layout (possibly your pause screen) when the window is too far from your favoured aspect ratio for playing.
    Sunday, January 19, 2014 10:13 PM
    Moderator
  • There is no way to force a specific size. Using a viewbox to zoom the app's layout to fit is a good tool, but you likely also want to check the window bounds and choose a different layout (possibly your pause screen) when the window is too far from your favoured aspect ratio for playing.

    I used the viewbox (letterbox) technique. I just filled the background with a plain colour.

    I just centred the game on the screen if it was bigger than 1024 by 768.

    As Rob says you can just put a pause screen in if the screen is too small.

    	CoreWindow^ m_window = CoreWindow::GetForCurrentThread();
    	Rect bounds = m_window->Bounds;
    	
    	int w,h;
    
    	w = (int) bounds.Width;
    	h = (int) bounds.Height;
    
    
    
    	//textures must be multiple of 32 pixels wide and same for height
    	//screen width/height must be rounded down by mod 32 or else doesnt display right !!!!
    	w = (w/32)*32;
    	h = (h/32)*32;
    
    	actualscreenwidth=w;
    	actualscreenheight=h;
    
    
    


    n.Wright

    • Marked as answer by Gretchelin Monday, January 20, 2014 12:45 AM
    Sunday, January 19, 2014 10:45 PM

All replies

  • you cant set a minimal requirement

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Saturday, January 18, 2014 2:58 PM
  • I see. so the only way is adding information on which resolution the game is best to be played?

    Because I found a winstore app game (forgot what it is) but in the system requirement, it said: 1366x768 resolution. So I thought I could set it to a fix resolution....

    Sunday, January 19, 2014 2:56 AM
  • I designed 2 games.

    1/ Fixed size for smallest screen resolution 1024*768

    2/ Full screen game that worked on any resolution.

    The first was easy to do.

    The second took a bit more work so as to fit any screen res.


    n.Wright


    Sunday, January 19, 2014 4:47 PM
  • hi, nigelwirght, thanks for your answer.

    so how do you set the fixed size?

    I can't find a way to set it fixed in app manifest (as Dave Smits said, no way to set it fixed size).

    But from tutorials from windows, it was written that game app may used fixed layout since it's mostly deal with bitmap etc. (this suggested using WinJS.UI.Viewbox, but honestly, I don't see any difference between using that and not, aside from my game became centered vertically and horizontally in the "unsupported" resolution.

    Note: I read somewhere once, there are some group that build a game for the same set res. as i am and when they sent the app to the winstore the app got rejected because it was' ugly' in other res (16:10 and 4:3). This is why I asked if there is some sort of a way to make it fixed size so people know it was best played for a certain set of resolution....


    Gretchelin

    Sunday, January 19, 2014 7:08 PM
  • There is no way to force a specific size. The user can choose anything from 500 pixels to the full width of the screen. The app must be able to deal gracefully with this. Using a viewbox to zoom the app's layout to fit is a good tool, but you likely also want to check the window bounds and choose a different layout (possibly your pause screen) when the window is too far from your favoured aspect ratio for playing.
    Sunday, January 19, 2014 10:13 PM
    Moderator
  • There is no way to force a specific size. Using a viewbox to zoom the app's layout to fit is a good tool, but you likely also want to check the window bounds and choose a different layout (possibly your pause screen) when the window is too far from your favoured aspect ratio for playing.

    I used the viewbox (letterbox) technique. I just filled the background with a plain colour.

    I just centred the game on the screen if it was bigger than 1024 by 768.

    As Rob says you can just put a pause screen in if the screen is too small.

    	CoreWindow^ m_window = CoreWindow::GetForCurrentThread();
    	Rect bounds = m_window->Bounds;
    	
    	int w,h;
    
    	w = (int) bounds.Width;
    	h = (int) bounds.Height;
    
    
    
    	//textures must be multiple of 32 pixels wide and same for height
    	//screen width/height must be rounded down by mod 32 or else doesnt display right !!!!
    	w = (w/32)*32;
    	h = (h/32)*32;
    
    	actualscreenwidth=w;
    	actualscreenheight=h;
    
    
    


    n.Wright

    • Marked as answer by Gretchelin Monday, January 20, 2014 12:45 AM
    Sunday, January 19, 2014 10:45 PM