Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can my game have a wide icon for the start screen?

I'm creating a game for WP8, but its in XNA. How can I make it have a wide icon for the start screen? Only small and normal is supported at default

like image 473
Jason94 Avatar asked Dec 19 '12 20:12

Jason94


Video Answer


1 Answers

Since XNA is only supported for WP7 apps you'll have to check if your app is running on WP8, and if so use reflection to update the tile to WP8 icons. There's a good example of how that code snippet would look like at this MSDN article @ Adding Windows Phone 8 Tile functionality to Windows Phone OS 7.1 apps

It might be easier on you to use the Mangopollo library which has that capability built-in with similar APIs to that of WP8. Here's the source code that wraps the WP8 APIs to be called from WP7 @ http://mangopollo.codeplex.com/SourceControl/changeset/view/100687#2023247

And here's the Mangopollo code snippet to use WP8 wide tiles in WP7 apps:

if (!Utils.CanUseLiveTiles)
{
    MessageBox.Show("This feature needs Windows Phone 8");
    return;
}

try
{
    var mytile = new FlipTileData
    {
        Title = "wide flip tile",
        BackTitle = "created by",
        BackContent = "Rudy Huyn",
        Count = 9,
        SmallBackgroundImage = new Uri("/Assets/logo159x159.png", UriKind.Relative),
        BackgroundImage = new Uri("/Assets/Background336x336_1.png", UriKind.Relative),
        BackBackgroundImage = new Uri("/Assets/Background336x336_2.png", UriKind.Relative),
        WideBackContent = "This is a very long long text to demonstrate the back content of a wide flip tile",
        WideBackgroundImage = new Uri("/Assets/Background691x336_1.png", UriKind.Relative),
        WideBackBackgroundImage = new Uri("/Assets/Background691x336_2.png", UriKind.Relative)
    };

#if ALTERNATIVE_SOLUTION
  var mytile = Mangopollo.Tiles.TilesCreator.CreateFlipTile("flip tile",
    "created by", "Rudy Huyn",
    "This is a very long long text to demonstrate the back content of a wide flip tile",
    9, new Uri("/Assets/logo159x159.png", UriKind.Relative),
    new Uri("/Assets/Background336x336_1.png", UriKind.Relative),
    new Uri("/Assets/Background336x336_2.png", UriKind.Relative),
    new Uri("/Assets/Background691x336_1.png", UriKind.Relative),
    new Uri("/Assets/Background691x336_2.png", UriKind.Relative));
#endif
    ShellTileExt.Create(new Uri("/MainPage.xaml?msg=from%20wipe%20flip%20tile",
      UriKind.Relative), mytile, true);
}
catch
{
    MessageBox.Show("remove tile before create it again");
}

One more thing to remember is that other WP8 APIs can be used directly from XNA even though XNA apps are WP7 apps. Here's an example on how to use WP8 in-app purhcase on WP7 apps (including XNA). And here's an example on how to use new WP8 Launchers & Choosers in WP7 apps (scroll down).

like image 84
JustinAngel Avatar answered Oct 23 '22 15:10

JustinAngel