6

WP8用のゲームを作成していますが、XNAで作成しています。スタート画面に幅の広いアイコンを付けるにはどうすればよいですか?デフォルトでは、スモールとノーマルのみがサポートされています

4

1 に答える 1

7

XNAはWP7アプリでのみサポートされているため、アプリがWP8で実行されているかどうかを確認する必要があります。実行されている場合は、リフレクションを使用してタイルをWP8アイコンに更新します。このMSDNの記事@ WindowsPhoneOS7.1アプリへのWindowsPhone8タイル機能の追加にそのコードスニペットがどのように表示されるかを示す良い例があります。

WP8と同様のAPIを備えた機能が組み込まれているMangopolloライブラリを使用する方が簡単な場合があります。WP7@ http: //mangopollo.codeplex.com/SourceControl/changeset/view/100687#2023247から呼び出されるWP8APIをラップするソースコードは次のとおりです。

そして、これがWP7アプリでWP8ワイドタイルを使用するためのMangopolloコードスニペットです。

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");
}

もう1つ覚えておくべきことは、XNAアプリはWP7アプリであっても、他のWP8APIをXNAから直接使用できることです。WP7アプリ(XNAを含む)でWP8アプリ内購入を使用する方法の例を次に示します。そして、WP7アプリで新しいWP8ランチャーとチューザーを使用する方法の例を次に示します(下にスクロールします)。

于 2012-12-19T21:22:46.657 に答える