Useful for Xbox Resolutions -
by Sean T. Boyette · in Torque X 3D · 01/29/2009 (11:58 pm) · 3 replies
If you have an interest in making one version of a game that conforms to all three xbox 360 standards, you can use the following to modify your bitmaps size, and position - and you only have to create one (720 for the below) version of the game!
implemented
/// <summary>
/// Changes Size of Bitmap Based on Resolution.
/// </summary>
public Vector2 changeBitmapSize(GUIBitmap button)
{
Vector2 vNewSize = new Vector2();
switch (Game.Instance.Window.ClientBounds.Height)
{
case 1080:
vNewSize = new Vector2(button.Size.X * 1.5f, button.Size.Y * 1.5f);
break;
case 720:
vNewSize = button.Size; //Do Nothing
break;
case 480:
vNewSize = new Vector2(button.Size.X / 1.77f, button.Size.Y / 1.77f);
break;
}
return vNewSize;
}
/// <summary>
/// Changes Position of Bitmap Based on Resolution.
/// </summary>
public Vector2 changeBitmapPosition(Vector2 btnPosition)
{
//Vector2 btnPosition = new Vector2(596, 323);
switch (Game.Instance.Window.ClientBounds.Height)
{
case 1080:
btnPosition = new Vector2(btnPosition.X * 1.5f, btnPosition.Y * 1.5f);
break;
case 720:
//Do nothing
break;
case 480:
btnPosition = new Vector2(btnPosition.X / 1.77f, btnPosition.Y / 1.77f);
break;
}
return btnPosition;
}implemented
button1.Position = changeBitmapPosition(new Vector2(596, 323));
button1.Size = changeBitmapSize(button1);About the author
#3
02/01/2009 (10:47 pm)
Thanks, this is very useful! Now, what are the numbers for iPhone resolutions, landscape and portrait? :)
Torque Owner Brandon
cod3r on irc