Game Development Community

GUI Pos/size difference on xbox

by Gavin Beard · in Torque X 2D · 06/15/2009 (9:09 am) · 5 replies

Hi all,

I have decided to test my current project on my Xbox to see how the GUI elements pan out. I've designed and tested the gui side on the PC extensively and they all worked perfectly. Now I am deploying to the xbox all the GUI elements seem to be out by quiet alot, everything seems to have shifted towards the centre of the screen by about 50-60 pixels. I have tried different resolutions on the xbox but the result is always the same.

On the PC my game res. and main gui control size is 1280 x 720. I have tried this res. and 1080p on my tv to see if I could sort it but no....

Any ideas what may be happening or a way of fixing?

Ta

#1
06/15/2009 (10:11 am)
Are you placing objects in the entire extent of the camera? Because I know there is the notion of a render-safe region for the camera that applies when it is rendered on a TV instead of a monitor. In TXB, the safe region is the inner rectangle of the visual representation of the camera extent.

I haven't really worked with safe regions much, but that could have something to do with your issues.
#2
06/15/2009 (10:22 am)
Hi Scott, everything is placed within the inner rectangle, unless of course it is resizing the gui to fit inside this area after i've already placed them inside this area. strange it would not affect it when running on pc.
#3
06/15/2009 (11:24 am)
Yeah, its a little screwy to straighten out, though I don't believe the safe region is used at all for PC which is why it seems normal there. If it is being squished together, then that does sound like it is putting the entire picture into the safe region. I've only worked with PC, not the XBOX, yet, so I can't say for certain if that's the case.

You may end up having to have different cameras, perhaps, one for PC and one for XBOX, and then use the appropriate one via directives, i.e.
#if XBOX
...
#else
...
#endif

Else, you could try saving the version that works for PC somewhere else, then changing whatever is needed to make it look good on XBOX, and so have different builds and thus different executables, one for PC and one for XBOX.

Not a great solution, but there is too many difficult to understand differences in how it works for PC vs XBOX to have a better one without more experience at cross-platform development.

If you have access to the source code, try searching the entire solution for "#if XBOX" or just "xbox". I noticed that GFXVideoMode in Torque.GFX has properties "VirtualWidth" and "VirtualHeight" which return either the back buffer dimensions or the display dimensions:
/// <summary>
/// The PC and XBOX differ on what is the actual display. On the PC, a game
/// can be windowed or fullscreen. This property takes this into account.
/// </summary>
public int VirtualWidth
{
    get
    {
#if XBOX
        return _displayWidth;
#else
        return _frameWidth;
#endif
    }
}
I can't put my finger on it, but it seems the back buffer size and display size are used differently for the platforms. Also, in TorqueSettings.xml, the XBOX has "UseDisplaySizeForBackbuffer" set to true, but not for PC.

Hope you can figure this one out, and maybe there are others here who have worked more with cross-platform development.
#4
06/15/2009 (12:25 pm)
Thanks for the help Scott, the issue you tend to get is that if you genable UseDisplaySizeForBackbuffer for XBox using Tilemaps seems to crash the Console (alot of posts about it). As I'm doing the gui via a component I can just have seperate components for PC and XBox. Although will be good to see what other people do for a solution to it.
#5
06/15/2009 (4:38 pm)
I was also having crashing problems (mostly around particle effects) and the messed up GUI's. If you have UseDisplaySizeforBackbuffer set to true then TX uses a backbuffer at the resolution of the players tv screen, which means you are responsible for drawing everything the correct size in your draw methods.
I set UseDisplaySizeForBackbuffer to false then set preferred back buffer width and height to 1280x720. This lets me have a set format I design and draw everything at, allows the xbox to auto-resize (or letterbox) the screen for the players screen size on the backend, stopped all the crashes, and the GUI's now work as I designed them.