commit bcda29cd87535f0908adbdfd211009cc16f378fe Author: sheychen Date: Wed Feb 8 19:42:03 2017 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4e82d27 --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +# Autosave files +*~ + +# build +[Oo]bj/ +[Bb]in/ +packages/ +TestResults/ + +# globs +Makefile.in +*.DS_Store +*.sln.cache +*.suo +*.cache +*.pidb +*.userprefs +*.usertasks +config.log +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.user +*.tar.gz +tarballs/ +test-results/ +Thumbs.db + +# Mac bundle stuff +*.dmg +*.app + +# resharper +*_Resharper.* +*.Resharper + +# dotCover +*.dotCover diff --git a/Exemple/Content/Content.mgcb b/Exemple/Content/Content.mgcb new file mode 100644 index 0000000..a14ef62 --- /dev/null +++ b/Exemple/Content/Content.mgcb @@ -0,0 +1,12 @@ +#----------------------------- Global Properties ----------------------------# + +/outputDir:bin/$(Platform) +/intermediateDir:obj/$(Platform) +/config: +/profile:Reach +/compress:False + +#-------------------------------- References --------------------------------# + + +#---------------------------------- Content ---------------------------------# diff --git a/Exemple/Content/Textures/Background.jpg b/Exemple/Content/Textures/Background.jpg new file mode 100755 index 0000000..ddfdb74 Binary files /dev/null and b/Exemple/Content/Textures/Background.jpg differ diff --git a/Exemple/Content/Textures/Boxes/0/bottomCenter.png b/Exemple/Content/Textures/Boxes/0/bottomCenter.png new file mode 100755 index 0000000..ba3882c Binary files /dev/null and b/Exemple/Content/Textures/Boxes/0/bottomCenter.png differ diff --git a/Exemple/Content/Textures/Boxes/0/bottomLeft.png b/Exemple/Content/Textures/Boxes/0/bottomLeft.png new file mode 100755 index 0000000..0565eb6 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/0/bottomLeft.png differ diff --git a/Exemple/Content/Textures/Boxes/0/bottomRight.png b/Exemple/Content/Textures/Boxes/0/bottomRight.png new file mode 100755 index 0000000..f4030d1 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/0/bottomRight.png differ diff --git a/Exemple/Content/Textures/Boxes/0/centerCenter.png b/Exemple/Content/Textures/Boxes/0/centerCenter.png new file mode 100755 index 0000000..cfff390 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/0/centerCenter.png differ diff --git a/Exemple/Content/Textures/Boxes/0/centerLeft.png b/Exemple/Content/Textures/Boxes/0/centerLeft.png new file mode 100755 index 0000000..0904246 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/0/centerLeft.png differ diff --git a/Exemple/Content/Textures/Boxes/0/centerRight.png b/Exemple/Content/Textures/Boxes/0/centerRight.png new file mode 100755 index 0000000..9547c0a Binary files /dev/null and b/Exemple/Content/Textures/Boxes/0/centerRight.png differ diff --git a/Exemple/Content/Textures/Boxes/0/topCenter.png b/Exemple/Content/Textures/Boxes/0/topCenter.png new file mode 100755 index 0000000..af78ce6 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/0/topCenter.png differ diff --git a/Exemple/Content/Textures/Boxes/0/topLeft.png b/Exemple/Content/Textures/Boxes/0/topLeft.png new file mode 100755 index 0000000..3fb9dc2 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/0/topLeft.png differ diff --git a/Exemple/Content/Textures/Boxes/0/topRight.png b/Exemple/Content/Textures/Boxes/0/topRight.png new file mode 100755 index 0000000..e581211 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/0/topRight.png differ diff --git a/Exemple/Content/Textures/Boxes/Button/0_0.png b/Exemple/Content/Textures/Boxes/Button/0_0.png new file mode 100755 index 0000000..3fb9dc2 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/Button/0_0.png differ diff --git a/Exemple/Content/Textures/Boxes/Button/0_1.png b/Exemple/Content/Textures/Boxes/Button/0_1.png new file mode 100755 index 0000000..af78ce6 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/Button/0_1.png differ diff --git a/Exemple/Content/Textures/Boxes/Button/0_2.png b/Exemple/Content/Textures/Boxes/Button/0_2.png new file mode 100755 index 0000000..e581211 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/Button/0_2.png differ diff --git a/Exemple/Content/Textures/Boxes/Button/1_0.png b/Exemple/Content/Textures/Boxes/Button/1_0.png new file mode 100755 index 0000000..0904246 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/Button/1_0.png differ diff --git a/Exemple/Content/Textures/Boxes/Button/1_1.png b/Exemple/Content/Textures/Boxes/Button/1_1.png new file mode 100755 index 0000000..cfff390 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/Button/1_1.png differ diff --git a/Exemple/Content/Textures/Boxes/Button/1_2.png b/Exemple/Content/Textures/Boxes/Button/1_2.png new file mode 100755 index 0000000..9547c0a Binary files /dev/null and b/Exemple/Content/Textures/Boxes/Button/1_2.png differ diff --git a/Exemple/Content/Textures/Boxes/Button/2_0.png b/Exemple/Content/Textures/Boxes/Button/2_0.png new file mode 100755 index 0000000..0565eb6 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/Button/2_0.png differ diff --git a/Exemple/Content/Textures/Boxes/Button/2_1.png b/Exemple/Content/Textures/Boxes/Button/2_1.png new file mode 100755 index 0000000..ba3882c Binary files /dev/null and b/Exemple/Content/Textures/Boxes/Button/2_1.png differ diff --git a/Exemple/Content/Textures/Boxes/Button/2_2.png b/Exemple/Content/Textures/Boxes/Button/2_2.png new file mode 100755 index 0000000..f4030d1 Binary files /dev/null and b/Exemple/Content/Textures/Boxes/Button/2_2.png differ diff --git a/Exemple/Exemple.csproj b/Exemple/Exemple.csproj new file mode 100644 index 0000000..0b0d5e1 --- /dev/null +++ b/Exemple/Exemple.csproj @@ -0,0 +1,90 @@ + + + + + Debug + x86 + {9C18BB68-EFE3-4E53-8761-B780F2BA5C52} + Exe + Exemple + Exemple + v4.5 + DesktopGL + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + x86 + + + true + bin\Release + prompt + 4 + x86 + + + + + + + $(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\MonoGame.Framework.dll + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + \ No newline at end of file diff --git a/Exemple/Icon.ico b/Exemple/Icon.ico new file mode 100644 index 0000000..7d9dec1 Binary files /dev/null and b/Exemple/Icon.ico differ diff --git a/Exemple/Icon.png b/Exemple/Icon.png new file mode 100644 index 0000000..ce7f8c4 Binary files /dev/null and b/Exemple/Icon.png differ diff --git a/Exemple/MainGame.cs b/Exemple/MainGame.cs new file mode 100644 index 0000000..6634476 --- /dev/null +++ b/Exemple/MainGame.cs @@ -0,0 +1,107 @@ +using System; +using MyMonoGameAddin; +using MyMonoGameAddin.UI; +using MyMonoGameAddin.Inputs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; + +namespace Exemple +{ + /// + /// This is the main type for your game. + /// + public class Game1 : Game + { + GraphicsDeviceManager graphics; + SpriteBatch spriteBatch; + ResourcesManager resources; + InputsManager inputs = new InputsManager(); + + Layout canvas = new Layout(); + Image pointer; + + const int ScreenWidth = 800; + const int ScreenHeight = 600; + + public Game1() + { + graphics = new GraphicsDeviceManager(this); + graphics.PreferredBackBufferWidth = ScreenWidth; + graphics.PreferredBackBufferHeight = ScreenHeight; + graphics.ApplyChanges(); + Content.RootDirectory = "Content"; + resources = new ResourcesManager(Content, GraphicsDevice); + } + + /// + /// 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() + { + 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); + + //resources.LoadFont("basic"); + //resources.LoadSound("bip"); + resources.LoadTexture("Background"); + resources.LoadBox("Button"); + + + BuildCanvas(); + //TODO: use this.Content to load your game 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) + { + inputs.Update(); + // 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) + { + pointer.Transform.Position = inputs.Mouse.Position; + + graphics.GraphicsDevice.Clear(Color.Black); + + //TODO: Add your drawing code here + spriteBatch.Begin(); + + canvas.Draw(spriteBatch, new Transform()); + + spriteBatch.End(); + + base.Draw(gameTime); + } + + private void BuildCanvas() + { + canvas.Children.Add(new Box(resources.Boxes["Button"], new Vector(10, 10), new Vector(100, 20), Color.White)); + pointer = new Image(resources.Textures["Background"], new Vector(0, 0), new Vector(10, 10), Color.White); + canvas.Children.Add(pointer); + } + } +} diff --git a/Exemple/MonoGame.Framework.dll.config b/Exemple/MonoGame.Framework.dll.config new file mode 100644 index 0000000..4100de1 --- /dev/null +++ b/Exemple/MonoGame.Framework.dll.config @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Exemple/Program.cs b/Exemple/Program.cs new file mode 100644 index 0000000..1967bdc --- /dev/null +++ b/Exemple/Program.cs @@ -0,0 +1,84 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +#if MONOMAC +using MonoMac.AppKit; +using MonoMac.Foundation; +#elif __IOS__ || __TVOS__ +using Foundation; +using UIKit; +#endif +#endregion + +namespace Exemple +{ +#if __IOS__ || __TVOS__ + [Register("AppDelegate")] + class Program : UIApplicationDelegate +#else + static class Program +#endif + { + private static Game1 game; + + internal static void RunGame() + { + game = new Game1(); + game.Run(); +#if !__IOS__ && !__TVOS__ + game.Dispose(); +#endif + } + + /// + /// The main entry point for the application. + /// +#if !MONOMAC && !__IOS__ && !__TVOS__ + [STAThread] +#endif + static void Main(string[] args) + { +#if MONOMAC + NSApplication.Init (); + + using (var p = new NSAutoreleasePool ()) { + NSApplication.SharedApplication.Delegate = new AppDelegate(); + NSApplication.Main(args); + } +#elif __IOS__ || __TVOS__ + UIApplication.Main(args, null, "AppDelegate"); +#else + RunGame(); +#endif + } + +#if __IOS__ || __TVOS__ + public override void FinishedLaunching(UIApplication app) + { + RunGame(); + } +#endif + } + +#if MONOMAC + class AppDelegate : NSApplicationDelegate + { + public override void FinishedLaunching (MonoMac.Foundation.NSObject notification) + { + AppDomain.CurrentDomain.AssemblyResolve += (object sender, ResolveEventArgs a) => { + if (a.Name.StartsWith("MonoMac")) { + return typeof(MonoMac.AppKit.AppKitFramework).Assembly; + } + return null; + }; + Program.RunGame(); + } + + public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender) + { + return true; + } + } +#endif +} diff --git a/Exemple/Properties/AssemblyInfo.cs b/Exemple/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8dc6504 --- /dev/null +++ b/Exemple/Properties/AssemblyInfo.cs @@ -0,0 +1,29 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +#if __ANDROID__ +using Android.App; +#endif + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("Exemple")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.0")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] diff --git a/Exemple/libSDL2-2.0.0.dylib b/Exemple/libSDL2-2.0.0.dylib new file mode 100644 index 0000000..6bc95e2 Binary files /dev/null and b/Exemple/libSDL2-2.0.0.dylib differ diff --git a/Exemple/libopenal.1.dylib b/Exemple/libopenal.1.dylib new file mode 100644 index 0000000..df9570d Binary files /dev/null and b/Exemple/libopenal.1.dylib differ diff --git a/Exemple/x64/SDL2.dll b/Exemple/x64/SDL2.dll new file mode 100644 index 0000000..460bd8e Binary files /dev/null and b/Exemple/x64/SDL2.dll differ diff --git a/Exemple/x64/libSDL2-2.0.so.0 b/Exemple/x64/libSDL2-2.0.so.0 new file mode 100644 index 0000000..ec8efa4 Binary files /dev/null and b/Exemple/x64/libSDL2-2.0.so.0 differ diff --git a/Exemple/x64/libopenal.so.1 b/Exemple/x64/libopenal.so.1 new file mode 100644 index 0000000..af45fd0 Binary files /dev/null and b/Exemple/x64/libopenal.so.1 differ diff --git a/Exemple/x64/soft_oal.dll b/Exemple/x64/soft_oal.dll new file mode 100644 index 0000000..e24538a Binary files /dev/null and b/Exemple/x64/soft_oal.dll differ diff --git a/Exemple/x86/SDL2.dll b/Exemple/x86/SDL2.dll new file mode 100644 index 0000000..f512bea Binary files /dev/null and b/Exemple/x86/SDL2.dll differ diff --git a/Exemple/x86/libSDL2-2.0.so.0 b/Exemple/x86/libSDL2-2.0.so.0 new file mode 100644 index 0000000..548d977 Binary files /dev/null and b/Exemple/x86/libSDL2-2.0.so.0 differ diff --git a/Exemple/x86/libopenal.so.1 b/Exemple/x86/libopenal.so.1 new file mode 100644 index 0000000..97a503b Binary files /dev/null and b/Exemple/x86/libopenal.so.1 differ diff --git a/Exemple/x86/soft_oal.dll b/Exemple/x86/soft_oal.dll new file mode 100644 index 0000000..1e3bddd Binary files /dev/null and b/Exemple/x86/soft_oal.dll differ diff --git a/MyMonoGameAddin.sln b/MyMonoGameAddin.sln new file mode 100644 index 0000000..c992d50 --- /dev/null +++ b/MyMonoGameAddin.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exemple", "Exemple\Exemple.csproj", "{9C18BB68-EFE3-4E53-8761-B780F2BA5C52}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9C18BB68-EFE3-4E53-8761-B780F2BA5C52}.Debug|x86.ActiveCfg = Debug|x86 + {9C18BB68-EFE3-4E53-8761-B780F2BA5C52}.Debug|x86.Build.0 = Debug|x86 + {9C18BB68-EFE3-4E53-8761-B780F2BA5C52}.Release|x86.ActiveCfg = Release|x86 + {9C18BB68-EFE3-4E53-8761-B780F2BA5C52}.Release|x86.Build.0 = Release|x86 + EndGlobalSection +EndGlobal diff --git a/MyMonoGameAddin/BoxTexture.cs b/MyMonoGameAddin/BoxTexture.cs new file mode 100644 index 0000000..e6a097a --- /dev/null +++ b/MyMonoGameAddin/BoxTexture.cs @@ -0,0 +1,11 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace MyMonoGameAddin +{ + public struct BoxSprite + { + public + } +} diff --git a/MyMonoGameAddin/Colors.cs b/MyMonoGameAddin/Colors.cs new file mode 100644 index 0000000..bdb30fc --- /dev/null +++ b/MyMonoGameAddin/Colors.cs @@ -0,0 +1,10 @@ +using System; +namespace MyMonoGameAddin +{ + public class Colors + { + public Colors() + { + } + } +} diff --git a/MyMonoGameAddin/GUIManager.cs b/MyMonoGameAddin/GUIManager.cs new file mode 100644 index 0000000..8d16158 --- /dev/null +++ b/MyMonoGameAddin/GUIManager.cs @@ -0,0 +1,10 @@ +using System; +namespace MyMonoGameAddin +{ + public class GUIManager + { + public GUIManager() + { + } + } +} diff --git a/MyMonoGameAddin/InputsManager.cs b/MyMonoGameAddin/InputsManager.cs new file mode 100644 index 0000000..6382f51 --- /dev/null +++ b/MyMonoGameAddin/InputsManager.cs @@ -0,0 +1,10 @@ +using System; +namespace MyMonoGameAddin +{ + public class InputsManager + { + public InputsManager() + { + } + } +} diff --git a/MyMonoGameAddin/MyMonoGameAddin.csproj b/MyMonoGameAddin/MyMonoGameAddin.csproj new file mode 100644 index 0000000..de1addf --- /dev/null +++ b/MyMonoGameAddin/MyMonoGameAddin.csproj @@ -0,0 +1,37 @@ + + + + Debug + AnyCPU + {FF4B3F52-D94E-4F54-A829-C1492B875267} + Library + MyMonoGameAddin + MyMonoGameAddin + v4.5 + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + + + true + bin\Release + prompt + 4 + false + + + + + + + + + + \ No newline at end of file diff --git a/MyMonoGameAddin/Properties/AssemblyInfo.cs b/MyMonoGameAddin/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..10dec16 --- /dev/null +++ b/MyMonoGameAddin/Properties/AssemblyInfo.cs @@ -0,0 +1,26 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("MyMonoGameAddin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] diff --git a/MyMonoGameAddin/ResourcesManager.cs b/MyMonoGameAddin/ResourcesManager.cs new file mode 100644 index 0000000..b7e8924 --- /dev/null +++ b/MyMonoGameAddin/ResourcesManager.cs @@ -0,0 +1,10 @@ +using System; +namespace MyMonoGameAddin +{ + public class MyClass + { + public MyClass() + { + } + } +} diff --git a/MyMonoGameAddin/Vector.cs b/MyMonoGameAddin/Vector.cs new file mode 100644 index 0000000..8636eac --- /dev/null +++ b/MyMonoGameAddin/Vector.cs @@ -0,0 +1,22 @@ +namespace MyMonoGameAddin +{ + public class Vector + { + public int X; + public int Y; + + public Vector(int x, int y) + { + X = x; + Y = y; + } + + public void Add(Vector v) + { + X += v.X; + Y += v.Y; + } + + public static Vector Zero { get { return new Vector(0, 0); } } + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..21b1fb6 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +MyMonoGameAddin