2016-04-16 6 views
0

私はMonogameを使ってアプリケーションを開発していますが、Windows Phoneのプロジェクトを追加したいと考えていました。テスト用にWindows Mobile 8.1搭載のデバイスがあり、Monogame 3.5(最新)+ VS 2015を使用しています。プロジェクトを作成するにはどうすればいいですか?Monogame + Windows 8.1のプロジェクトをセットアップするには?

Monogameのテンプレートにはいくつかのプラットフォームがありますが、Windows Mobile用のテンプレートはWindows 10 Uniwersal Project(UWP)のようです。私はこれがWM8.1上で動作するのではないかと疑います。それとも?そうでない場合は、どうすればこのプロジェクトを作成できますか?

更新:

は、これに関する詳細な研究を行なったし、あなたがWindowsの携帯電話8.1のために開発してお使いのdevのPC上で最小のWindows 8.1を持っている必要がありそうです:

https://www.visualstudio.com/en-us/products/visual-studio-2015-compatibility-vs.aspx

だから私は推測します他のすべてのモバイルアプリと同様にAndroidとiOSをサポートします。

答えて

1

バリアント1:

  • 勝利電話を作成8.1プロジェクト
  • はNuGetパッケージMonoGame.Framework.WindowsPhone81(NuGet)
  • を追加Monogameテンプレート
  • からスタンダールGame1.csソースコードファイルを追加します。
  • MainPage.xaml.csに追加

    using MonoGame.Framework; 
    
  • MainPage.xaml.cs

    public sealed partial class MainPage : SwapChainBackgroundPanel 
    { 
        readonly Game1 _game; 
    
        public MainPage(string launchArguments) 
        { 
         this.InitializeComponent(); 
    
         _game = XamlGame<Game1>.Create(launchArguments, Window.Current.CoreWindow, this); 
        } 
    } 
    
  • 変更MainPage.xamlを(MyGame - デフォルトプロジェクトの名前空間)の変更App.xaml.cs

    protected override void OnLaunched(LaunchActivatedEventArgs args) 
    { 
        var gamePage = Window.Current.Content as MainPage; 
    
        if (gamePage == null) 
        { 
         gamePage = new MainPage(args.Arguments); 
    
         if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) 
         { 
         } 
    
         Window.Current.Content = gamePage; 
        } 
    
        Window.Current.Activate(); 
    } 
    
    private void OnSuspending(object sender, SuspendingEventArgs e) 
    { 
        var deferral = e.SuspendingOperation.GetDeferral(); 
    
        deferral.Complete(); 
    } 
    

    <SwapChainBackgroundPanel 
        x:Class="MyGame.MainPage" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:local="using:MyGame" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        mc:Ignorable="d"> 
    
        <Grid > 
    
        </Grid> 
    </SwapChainBackgroundPanel> 
    
  • 変更のAppクラス

  • Add Content.mgcb

  • <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" /> 
    

、プロジェクトのセクションにファイル(.csproj)を投影する次の行を追加します

<PropertyGroup> 
... 
<MonoGamePlatform>WindowsStoreApp</MonoGamePlatform> 
<MonoGameContentBuilderExe> 
</MonoGameContentBuilderExe> 
... 
</PropertyGroup> 
  • PropertyGroupセクションに(.csproj)ファイルを投影するバリアント2 monogameplatformを追加します。をProtobuild.orgのツールを使用してください。

  • +0

    どちらも機能しませんでした。 Protobuild(variant 2)はプロジェクトを作成しましたが、VSはそれを開くことができません。バリアント1では、Windows Phone 8.1プロジェクトを作成するオプションはまったくないようです。私はより多くの研究をしました。問題はWindows 7のラップトップOSだと思われます。私はあなたの答えを新しいOSでうまく動作し、問題を更新するのに有効とマークします。 – Arek

    関連する問題