From c4c0f3c887d627b6432551e96009c7aeecd4cdd8 Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Sat, 9 Dec 2017 11:55:50 +0100 Subject: Add project files. --- Penguloon.sln | 27 +++++++++ Penguloon/Activity1.cs | 27 +++++++++ Penguloon/Assets/AboutAssets.txt | 19 ++++++ Penguloon/Content/Content.mgcb | 15 +++++ Penguloon/Game1.cs | 88 +++++++++++++++++++++++++++ Penguloon/Penguloon.csproj | 100 +++++++++++++++++++++++++++++++ Penguloon/Properties/AssemblyInfo.cs | 41 +++++++++++++ Penguloon/Resources/AboutResources.txt | 44 ++++++++++++++ Penguloon/Resources/Drawable/Icon.png | Bin 0 -> 24313 bytes Penguloon/Resources/Drawable/Splash.png | Bin 0 -> 33526 bytes Penguloon/Resources/Resource.Designer.cs | 65 ++++++++++++++++++++ Penguloon/Resources/Values/Strings.xml | 5 ++ Penguloon/Resources/Values/Styles.xml | 7 +++ 13 files changed, 438 insertions(+) create mode 100644 Penguloon.sln create mode 100644 Penguloon/Activity1.cs create mode 100644 Penguloon/Assets/AboutAssets.txt create mode 100644 Penguloon/Content/Content.mgcb create mode 100644 Penguloon/Game1.cs create mode 100644 Penguloon/Penguloon.csproj create mode 100644 Penguloon/Properties/AssemblyInfo.cs create mode 100644 Penguloon/Resources/AboutResources.txt create mode 100644 Penguloon/Resources/Drawable/Icon.png create mode 100644 Penguloon/Resources/Drawable/Splash.png create mode 100644 Penguloon/Resources/Resource.Designer.cs create mode 100644 Penguloon/Resources/Values/Strings.xml create mode 100644 Penguloon/Resources/Values/Styles.xml diff --git a/Penguloon.sln b/Penguloon.sln new file mode 100644 index 0000000..94c6c87 --- /dev/null +++ b/Penguloon.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27004.2009 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Penguloon", "Penguloon\Penguloon.csproj", "{6C46FE18-F5D6-4255-A202-475C1AB5EDAE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6C46FE18-F5D6-4255-A202-475C1AB5EDAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6C46FE18-F5D6-4255-A202-475C1AB5EDAE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6C46FE18-F5D6-4255-A202-475C1AB5EDAE}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {6C46FE18-F5D6-4255-A202-475C1AB5EDAE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6C46FE18-F5D6-4255-A202-475C1AB5EDAE}.Release|Any CPU.Build.0 = Release|Any CPU + {6C46FE18-F5D6-4255-A202-475C1AB5EDAE}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1E71D667-C944-4E28-9CF5-011D027E6691} + EndGlobalSection +EndGlobal diff --git a/Penguloon/Activity1.cs b/Penguloon/Activity1.cs new file mode 100644 index 0000000..ac9aa1e --- /dev/null +++ b/Penguloon/Activity1.cs @@ -0,0 +1,27 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; +using Android.Views; + +namespace Penguloon +{ + [Activity(Label = "Penguloon" + , 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)] + 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(); + } + } +} + diff --git a/Penguloon/Assets/AboutAssets.txt b/Penguloon/Assets/AboutAssets.txt new file mode 100644 index 0000000..ee39886 --- /dev/null +++ b/Penguloon/Assets/AboutAssets.txt @@ -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"); \ No newline at end of file diff --git a/Penguloon/Content/Content.mgcb b/Penguloon/Content/Content.mgcb new file mode 100644 index 0000000..895694b --- /dev/null +++ b/Penguloon/Content/Content.mgcb @@ -0,0 +1,15 @@ + +#----------------------------- Global Properties ----------------------------# + +/outputDir:bin/$(Platform) +/intermediateDir:obj/$(Platform) +/platform:Android +/config: +/profile:Reach +/compress:False + +#-------------------------------- References --------------------------------# + + +#---------------------------------- Content ---------------------------------# + diff --git a/Penguloon/Game1.cs b/Penguloon/Game1.cs new file mode 100644 index 0000000..b77d9c4 --- /dev/null +++ b/Penguloon/Game1.cs @@ -0,0 +1,88 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; + +namespace Penguloon +{ + /// + /// This is the main type for your game. + /// + 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; + } + + /// + /// 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. + /// + protected override void Initialize() + { + // TODO: Add your initialization logic here + + base.Initialize(); + } + + /// + /// LoadContent will be called once per game and is the place to load + /// all of your content. + /// + 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 + } + + /// + /// UnloadContent will be called once per game and is the place to unload + /// game-specific content. + /// + protected override void UnloadContent() + { + // TODO: Unload any non ContentManager content here + } + + /// + /// Allows the game to run logic such as updating the world, + /// checking for collisions, gathering input, and playing audio. + /// + /// Provides a snapshot of timing values. + 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); + } + + /// + /// This is called when the game should draw itself. + /// + /// Provides a snapshot of timing values. + protected override void Draw(GameTime gameTime) + { + GraphicsDevice.Clear(Color.CornflowerBlue); + + // TODO: Add your drawing code here + + base.Draw(gameTime); + } + } +} diff --git a/Penguloon/Penguloon.csproj b/Penguloon/Penguloon.csproj new file mode 100644 index 0000000..bfeba13 --- /dev/null +++ b/Penguloon/Penguloon.csproj @@ -0,0 +1,100 @@ + + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {6C46FE18-F5D6-4255-A202-475C1AB5EDAE} + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + Penguloon + Penguloon + 512 + true + Resources\Resource.Designer.cs + Off + armeabi-v7a%3bx86 + .m4a + + v8.0 + Android + Properties\AndroidManifest.xml + True + + + true + full + false + bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\ + DEBUG;TRACE;ANDROID + prompt + 4 + True + None + + + pdbonly + true + bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\ + TRACE;ANDROID + prompt + 4 + False + SdkOnly + + + + + + + + + + + $(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\Android\MonoGame.Framework.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Penguloon/Properties/AssemblyInfo.cs b/Penguloon/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1bf37ac --- /dev/null +++ b/Penguloon/Properties/AssemblyInfo.cs @@ -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("Penguloon")] +[assembly: AssemblyProduct("Penguloon")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[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("f097d323-9e8d-4abc-bc99-484629dd0ad3")] + +// 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)] diff --git a/Penguloon/Resources/AboutResources.txt b/Penguloon/Resources/AboutResources.txt new file mode 100644 index 0000000..b0fc999 --- /dev/null +++ b/Penguloon/Resources/AboutResources.txt @@ -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. \ No newline at end of file diff --git a/Penguloon/Resources/Drawable/Icon.png b/Penguloon/Resources/Drawable/Icon.png new file mode 100644 index 0000000..f6f4f41 Binary files /dev/null and b/Penguloon/Resources/Drawable/Icon.png differ diff --git a/Penguloon/Resources/Drawable/Splash.png b/Penguloon/Resources/Drawable/Splash.png new file mode 100644 index 0000000..2f86107 Binary files /dev/null and b/Penguloon/Resources/Drawable/Splash.png differ diff --git a/Penguloon/Resources/Resource.Designer.cs b/Penguloon/Resources/Resource.Designer.cs new file mode 100644 index 0000000..d408e93 --- /dev/null +++ b/Penguloon/Resources/Resource.Designer.cs @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace Penguloon +{ + + + 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() + { + } + } + } +} diff --git a/Penguloon/Resources/Values/Strings.xml b/Penguloon/Resources/Values/Strings.xml new file mode 100644 index 0000000..01bbd6d --- /dev/null +++ b/Penguloon/Resources/Values/Strings.xml @@ -0,0 +1,5 @@ + + + Hello World, Click Me! + Penguloon + diff --git a/Penguloon/Resources/Values/Styles.xml b/Penguloon/Resources/Values/Styles.xml new file mode 100644 index 0000000..5102134 --- /dev/null +++ b/Penguloon/Resources/Values/Styles.xml @@ -0,0 +1,7 @@ + + + + -- cgit v1.2.3-70-g09d2