(ded4a3e0a) v0.9.0.7
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using Android.App;
|
||||
using Android.Content.PM;
|
||||
using Android.OS;
|
||||
using Android.Views;
|
||||
|
||||
namespace $safeprojectname$
|
||||
{
|
||||
[Activity(Label = "$projectname$"
|
||||
, MainLauncher = true
|
||||
, Icon = "@drawable/icon"
|
||||
, Theme = "@style/Theme.Splash"
|
||||
, AlwaysRetainTaskState=true
|
||||
, LaunchMode=Android.Content.PM.LaunchMode.SingleInstance
|
||||
, ScreenOrientation = ScreenOrientation.FullUser
|
||||
, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize | ConfigChanges.ScreenLayout)]
|
||||
public class Activity1 : Microsoft.Xna.Framework.AndroidGameActivity
|
||||
{
|
||||
protected override void OnCreate(Bundle bundle)
|
||||
{
|
||||
base.OnCreate(bundle);
|
||||
var g = new Game1();
|
||||
SetContentView((View)g.Services.GetService(typeof(View)));
|
||||
g.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>$guid1$</ProjectGuid>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>$safeprojectname$</RootNamespace>
|
||||
<AssemblyName>$safeprojectname$</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AndroidApplication>true</AndroidApplication>
|
||||
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<AndroidSupportedAbis>armeabi-v7a%3bx86</AndroidSupportedAbis>
|
||||
<AndroidStoreUncompressedFileExtensions>.m4a</AndroidStoreUncompressedFileExtensions>
|
||||
<MandroidI18n />
|
||||
<TargetFrameworkVersion>v4.4</TargetFrameworkVersion>
|
||||
<MonoGamePlatform>Android</MonoGamePlatform>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;ANDROID</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DefineConstants>TRACE;ANDROID</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
|
||||
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Mono.Android" />
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="OpenTK-1.0" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="MonoGame.Framework">
|
||||
<HintPath>$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\Android\MonoGame.Framework.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Activity1.cs" />
|
||||
<Compile Include="Game1.cs" />
|
||||
<Compile Include="Resources\Resource.Designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
<None Include="Assets\AboutAssets.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\Values\Strings.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\Drawable\Icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\Layout\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\Drawable\Splash.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\Values\Styles.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<MonoGameContentReference Include="Content\Content.mgcb" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,19 @@
|
||||
Any raw assets you want to be deployed with your application can be placed in
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||
|
||||
These files will be deployed with you package and will be accessible using Android's
|
||||
AssetManager, like this:
|
||||
|
||||
public class ReadAsset : Activity
|
||||
{
|
||||
protected override void OnCreate (Bundle bundle)
|
||||
{
|
||||
base.OnCreate (bundle);
|
||||
|
||||
InputStream input = Assets.Open ("my_asset.txt");
|
||||
}
|
||||
}
|
||||
|
||||
Additionally, some Android functions will automatically load asset files:
|
||||
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
#----------------------------- Global Properties ----------------------------#
|
||||
|
||||
/outputDir:bin/$(Platform)
|
||||
/intermediateDir:obj/$(Platform)
|
||||
/platform:Android
|
||||
/config:
|
||||
/profile:Reach
|
||||
/compress:False
|
||||
|
||||
#-------------------------------- References --------------------------------#
|
||||
|
||||
|
||||
#---------------------------------- Content ---------------------------------#
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
|
||||
namespace $safeprojectname$
|
||||
{
|
||||
/// <summary>
|
||||
/// This is the main type for your game.
|
||||
/// </summary>
|
||||
public class Game1 : Game
|
||||
{
|
||||
GraphicsDeviceManager graphics;
|
||||
SpriteBatch spriteBatch;
|
||||
|
||||
public Game1()
|
||||
{
|
||||
graphics = new GraphicsDeviceManager(this);
|
||||
Content.RootDirectory = "Content";
|
||||
|
||||
graphics.IsFullScreen = true;
|
||||
graphics.PreferredBackBufferWidth = 800;
|
||||
graphics.PreferredBackBufferHeight = 480;
|
||||
graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows the game to perform any initialization it needs to before starting to run.
|
||||
/// This is where it can query for any required services and load any non-graphic
|
||||
/// related content. Calling base.Initialize will enumerate through any components
|
||||
/// and initialize them as well.
|
||||
/// </summary>
|
||||
protected override void Initialize()
|
||||
{
|
||||
// TODO: Add your initialization logic here
|
||||
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LoadContent will be called once per game and is the place to load
|
||||
/// all of your content.
|
||||
/// </summary>
|
||||
protected override void LoadContent()
|
||||
{
|
||||
// Create a new SpriteBatch, which can be used to draw textures.
|
||||
spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||
|
||||
// TODO: use this.Content to load your game content here
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UnloadContent will be called once per game and is the place to unload
|
||||
/// game-specific content.
|
||||
/// </summary>
|
||||
protected override void UnloadContent()
|
||||
{
|
||||
// TODO: Unload any non ContentManager content here
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows the game to run logic such as updating the world,
|
||||
/// checking for collisions, gathering input, and playing audio.
|
||||
/// </summary>
|
||||
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
||||
protected override void Update(GameTime gameTime)
|
||||
{
|
||||
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
|
||||
Exit();
|
||||
|
||||
// TODO: Add your update logic here
|
||||
|
||||
base.Update(gameTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is called when the game should draw itself.
|
||||
/// </summary>
|
||||
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
||||
protected override void Draw(GameTime gameTime)
|
||||
{
|
||||
GraphicsDevice.Clear(Color.CornflowerBlue);
|
||||
|
||||
// TODO: Add your drawing code here
|
||||
|
||||
base.Draw(gameTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project">
|
||||
<TemplateData>
|
||||
<Name>MonoGame Android Project</Name>
|
||||
<Description>A MonoGame game project for Android which requires "Mono for Android" by Xamarin.</Description>
|
||||
<ProjectType>CSharp</ProjectType>
|
||||
<NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
|
||||
<ProjectSubType>
|
||||
</ProjectSubType>
|
||||
<SortOrder>43200</SortOrder>
|
||||
<CreateNewFolder>true</CreateNewFolder>
|
||||
<DefaultName>Game</DefaultName>
|
||||
<ProvideDefaultName>true</ProvideDefaultName>
|
||||
<LocationField>Enabled</LocationField>
|
||||
<EnableLocationBrowseButton>true</EnableLocationBrowseButton>
|
||||
<Icon>__TemplateIcon.png</Icon>
|
||||
<PreviewImage>__PreviewImage.png</PreviewImage>
|
||||
</TemplateData>
|
||||
<TemplateContent>
|
||||
<Project TargetFileName="AndroidApplication1.csproj" File="AndroidApplication1.csproj" ReplaceParameters="true">
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="Activity1.cs">Activity1.cs</ProjectItem>
|
||||
<Folder Name="Assets" TargetFolderName="Assets">
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="AboutAssets.txt">AboutAssets.txt</ProjectItem>
|
||||
</Folder>
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="Game1.cs">Game1.cs</ProjectItem>
|
||||
<Folder Name="Properties" TargetFolderName="Properties">
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="AssemblyInfo.cs">AssemblyInfo.cs</ProjectItem>
|
||||
</Folder>
|
||||
<Folder Name="Resources" TargetFolderName="Resources">
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="AboutResources.txt">AboutResources.txt</ProjectItem>
|
||||
<Folder Name="Drawable" TargetFolderName="Drawable">
|
||||
<ProjectItem ReplaceParameters="false" TargetFileName="Icon.png">Icon.png</ProjectItem>
|
||||
<ProjectItem ReplaceParameters="false" TargetFileName="Splash.png">Splash.png</ProjectItem>
|
||||
</Folder>
|
||||
<Folder Name="Layout" TargetFolderName="Layout" />
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="Resource.Designer.cs">Resource.Designer.cs</ProjectItem>
|
||||
<Folder Name="Values" TargetFolderName="Values">
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="Strings.xml">Strings.xml</ProjectItem>
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="Styles.xml">Styles.xml</ProjectItem>
|
||||
</Folder>
|
||||
</Folder>
|
||||
<Folder Name="Content" TargetFolderName="Content">
|
||||
<ProjectItem ReplaceParameters="true" TargetFileName="Content.mgcb">Content.mgcb</ProjectItem>
|
||||
</Folder>
|
||||
</Project>
|
||||
</TemplateContent>
|
||||
</VSTemplate>
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Android.App;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("$projectname$")]
|
||||
[assembly: AssemblyProduct("$projectname$")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyCompany("$registeredorganization$")]
|
||||
[assembly: AssemblyCopyright("Copyright © $registeredorganization$ $year$")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("$guid2$")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
// Add some common permissions, these can be removed if not needed
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
|
||||
@@ -0,0 +1,44 @@
|
||||
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||
in your application as resource files. Various Android APIs are designed to
|
||||
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||
directly.
|
||||
|
||||
For example, a sample Android app that contains a user interface layout (Main.xml),
|
||||
an internationalization string table (Strings.xml) and some icons (drawable/Icon.png)
|
||||
would keep its resources in the "Resources" directory of the application:
|
||||
|
||||
Resources/
|
||||
Drawable/
|
||||
Icon.png
|
||||
|
||||
Layout/
|
||||
Main.axml
|
||||
|
||||
Values/
|
||||
Strings.xml
|
||||
|
||||
In order to get the build system to recognize Android resources, the build action should be set
|
||||
to "AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||
the build system will package the resources for distribution and generate a class called
|
||||
"Resource" that contains the tokens for each one of the resources included. For example,
|
||||
for the above Resources layout, this is what the Resource class would expose:
|
||||
|
||||
public class Resource {
|
||||
public class Drawable {
|
||||
public const int Icon = 0x123;
|
||||
}
|
||||
|
||||
public class Layout {
|
||||
public const int Main = 0x456;
|
||||
}
|
||||
|
||||
public class String {
|
||||
public const int FirstString = 0xabc;
|
||||
public const int SecondString = 0xbcd;
|
||||
}
|
||||
}
|
||||
|
||||
You would then use Resource.Drawable.Icon to reference the Drawable/Icon.png file, or
|
||||
Resource.Layout.Main to reference the Layout/Main.axml file, or Resource.String.FirstString
|
||||
to reference the first string in the dictionary file Values/Strings.xml.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
@@ -0,0 +1,65 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.269
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace $safeprojectname$
|
||||
{
|
||||
|
||||
|
||||
public partial class Resource
|
||||
{
|
||||
|
||||
public partial class Attribute
|
||||
{
|
||||
|
||||
private Attribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Drawable
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f020000
|
||||
public const int Icon = 2130837504;
|
||||
|
||||
// aapt resource value: 0x7f020001
|
||||
public const int Splash = 2130837505;
|
||||
|
||||
private Drawable()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class String
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f030001
|
||||
public const int ApplicationName = 2130903041;
|
||||
|
||||
// aapt resource value: 0x7f030000
|
||||
public const int Hello = 2130903040;
|
||||
|
||||
private String()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Style
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f040000
|
||||
public const int Theme_Splash = 2130968576;
|
||||
|
||||
private Style()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="Hello">Hello World, Click Me!</string>
|
||||
<string name="ApplicationName">$safeprojectname$</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Theme.Splash" parent="android:Theme">
|
||||
<item name="android:windowBackground">@drawable/splash</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Reference in New Issue
Block a user