From b75bb765fe3a18ca05262e1a02cd5faeec94c54c Mon Sep 17 00:00:00 2001 From: randolphburt Date: Fri, 25 Apr 2014 00:24:56 +0100 Subject: [PATCH] Link existing assets and code from XNA example to make a MonoGame WindowsStore example project. --- .gitignore | 4 + .../windows8-store/example/Assets/Logo.png | Bin 0 -> 801 bytes .../example/Assets/SmallLogo.png | Bin 0 -> 329 bytes .../example/Assets/SplashScreen.png | Bin 0 -> 2146 bytes .../example/Assets/StoreLogo.png | Bin 0 -> 429 bytes .../example/Package.appxmanifest | 27 +++ .../example/Properties/AssemblyInfo.cs | 33 ++++ .../example/spine-monogame-example.csproj | 187 ++++++++++++++++++ .../example/spine-monogame-example.sln | 64 ++++++ spine-xna/example/src/ExampleGame.cs | 18 +- spine-xna/example/src/ExampleProgram.cs | 12 ++ 11 files changed, 343 insertions(+), 2 deletions(-) create mode 100644 spine-monogame/windows8-store/example/Assets/Logo.png create mode 100644 spine-monogame/windows8-store/example/Assets/SmallLogo.png create mode 100644 spine-monogame/windows8-store/example/Assets/SplashScreen.png create mode 100644 spine-monogame/windows8-store/example/Assets/StoreLogo.png create mode 100644 spine-monogame/windows8-store/example/Package.appxmanifest create mode 100644 spine-monogame/windows8-store/example/Properties/AssemblyInfo.cs create mode 100644 spine-monogame/windows8-store/example/spine-monogame-example.csproj create mode 100644 spine-monogame/windows8-store/example/spine-monogame-example.sln diff --git a/.gitignore b/.gitignore index 0ecf4d690..dbf43f577 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,10 @@ spine-monogame/xamarinstudio-ios/src/obj spine-monogame/windows8-store/src/bin spine-monogame/windows8-store/src/obj +spine-monogame/windows8-store/example/spine-monogame-example_TemporaryKey.pfx +spine-monogame/windows8-store/example/obj/* +spine-monogame/windows8-store/example/bin/* + spine-xna/bin spine-xna/obj spine-xna/example/bin diff --git a/spine-monogame/windows8-store/example/Assets/Logo.png b/spine-monogame/windows8-store/example/Assets/Logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e26771cb33a49bbef824aa333737181b0a5b09a3 GIT binary patch literal 801 zcmeAS@N?(olHy`uVBq!ia0vp^(?FPm4M^HB7Cr(}k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+m=1foIEGZ*dUJQLud<^=L*gE#63Ho!PGzwUb%GPK6&5iF zt!p@aGNX}6(PVh|N)M-?0RNcTbjaWgEU8noxUax-n>&3Ay)#!y&O11y2sKEF zt72@XC1)RvT6Xw=y_`Ce)`nGULLL^lI$kwi^E+dQT7YeXY4GvlRR%kj1x$VZi%Bdd zz}2Giy=-_$h+v#(S+};)DuE4EM?_^qB_eDeo@&q%StD1F>L|*0ZC2sb-}llSMTM?O z6{b3iid~yk@VE7q7Wb+P8?H5IYp?pSVcLE~18m#ygK20HL@6W5woI~Fjlw$fX1U{xQA5a+t0 zH$WNIb=fNpWHo}M9#;K6eszDZKty_|-?j4iocj5#zotrWc;@;w`H@=mjsvS2wXX0_ zY}l$4@^sE?UcC)ji*L=Z&}P!xaL&2((OQlj2dv~pV-ifAS;ZsH1{`D!GY%yys5WH)f>ZLo5m%6XjuXdbKMR7MEHSyb{m!_{Afji&MT$_sz7 z>1{~MlIFe28FRN(GC_~;#Jp4ADipP+9hh|P#-&`vO-Upt3jE0@YLh(^55uYWl9g)Z RA3>Rb!PC{xWt~$(69A&hN*MqE literal 0 HcmV?d00001 diff --git a/spine-monogame/windows8-store/example/Assets/SmallLogo.png b/spine-monogame/windows8-store/example/Assets/SmallLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..1eb0d9d528c42f132872e8af4dc563081b0b9aff GIT binary patch literal 329 zcmV-P0k-~$P)q$gGRCwC#*X;?zAP@%N+|i#I!$mrh zlQ>KU$Rdu>|JH&931_?y6Djl{gb>4nCV5pzDJ?S!mq|4ZejKj%i@j$H{#ML~2Y{DF z$=}bKPaz+UGt{v(4CTQQXym}&iW8{s!ew~XIE7NLjQpy#I2S$rous$~?f%DHT#B*+ zq=#!zc5=0FEqWFpB%UE(L807on!pidHPLgYO}XEgorrg;PB=8ipgQ5u5`&g_MQaRd zaU7Ao8XQMuuN21-s0PPTs1%38x_Yl3Fs-|Y4!C-;M-8g@n*v@1|s#GQ665=9@Rxy?u0YW0&WN+~=RXpPbVXXL4m7Aq=E6I0%{06TwRn=U9d8>exk> zD-Z%M3DNQ`bTLSEF=%NFyoHcAkD*CiXqljo*0E?o$GiDC4q}}|%*0WghLlK#npw?hecrM}Mw?`E(z5C8< z8&*b^!{>5?4aT89vdrgBgSc-x6JZD3F^l#*G(@OO*^1D%Eu7?HAy<3kTLqW9N{^#6vso zVQwY48q7)m{~xQ64RV7{E7Y=&T~?^05Ky`5oNQ8bLgFCPq9co^R09BVRS1OAmH;hU zC#q(N!gNqm!zU#%sv{r5mm-Uv8b-~a1F-;p^>)pnXfKge4s9?;;MFIr*fixPG}NBA z6_G5BEmeO6XXh(emkciB{7tA;iwC2^s^VzyU_h0@ae84ACMY`cIDEju=<`q|2QAEv zW_)W|i|9aknqdmS=#w73eW_csQ$8IhT^vY1^1;X3&J0{%*tcQq!gJpr3w?TJc~@5= zKV5sM{$3k>b#S$@CTkhIF*{v*u(F&$&Yq1naHxt8Mz2N%7aQ3(^VNRZahk1||7?Bl z*idzO_u)FhRj4cPzDO>YA>>lxAGaciEiX8Xzp1SVPv91};$OG3cC&8!v3{Jq^kH@8 UTIccK;hzT5*3#}uZuEx!0OwrBv;Y7A literal 0 HcmV?d00001 diff --git a/spine-monogame/windows8-store/example/Assets/StoreLogo.png b/spine-monogame/windows8-store/example/Assets/StoreLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..dcb672712c6823a0c91548ded70a8acb85536b4d GIT binary patch literal 429 zcmV;e0aE^nP)NtYJa1l)bQ5qwGXpZbs7%2oRMd4y35$s&66(fxhNg8W02!vSn zdlrL2h^Fx+3=$z;kK{0D#MyeJ8WRWZcLSf(PcQ_mLOhrmC}O-tX^0c>5`YvCUZVsc zG-6#78ubjJ5nA;OX&^K(q=i6ZNE3m?kTwE^AqxZoLskfB3|S&1F=UO9!cY$g2@Lgu z;9{sJ1P9|X2L`r1#Gs8R{E^$PRrMaC86q| + + + + spine-monogame-example + Spine + Assets\StoreLogo.png + + + 6.2.1 + 6.2.1 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spine-monogame/windows8-store/example/Properties/AssemblyInfo.cs b/spine-monogame/windows8-store/example/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..82df9295a --- /dev/null +++ b/spine-monogame/windows8-store/example/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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("spine-monogame-example")] +[assembly: AssemblyProduct("spine-monogame-example")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[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)] + +// 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")] diff --git a/spine-monogame/windows8-store/example/spine-monogame-example.csproj b/spine-monogame/windows8-store/example/spine-monogame-example.csproj new file mode 100644 index 000000000..7d50a13bb --- /dev/null +++ b/spine-monogame/windows8-store/example/spine-monogame-example.csproj @@ -0,0 +1,187 @@ + + + + + Debug + AnyCPU + {0A121D95-0803-47DC-B839-FF76AE8F7E7F} + AppContainerExe + Properties + Spine + spine-monogame-example + en-US + 512 + {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + spine-monogame-example_TemporaryKey.pfx + + + AnyCPU + true + full + false + bin\Windows8\Debug\ + TRACE;DEBUG;NETFX_CORE;WINDOWS_STOREAPP + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Windows8\Release\ + TRACE;NETFX_CORE;WINDOWS_STOREAPP + prompt + 4 + + + true + bin\Windows8\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + ARM + false + prompt + true + + + bin\Windows8\ARM\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + ARM + false + prompt + true + + + true + bin\Windows8\x64\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x64 + false + prompt + true + + + bin\Windows8\x64\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x64 + false + prompt + true + + + true + bin\Windows8\x86\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x86 + false + prompt + true + + + bin\Windows8\x86\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x86 + false + prompt + true + + + + + $(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Windows8\MonoGame.Framework.dll + + + $(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Windows8\SharpDX.dll + + + $(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Windows8\SharpDX.XInput.dll + + + $(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Windows8\SharpDX.Direct2D1.dll + + + $(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Windows8\SharpDX.Direct3D11.dll + + + $(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Windows8\SharpDX.DXGI.dll + + + $(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Windows8\SharpDX.MediaFoundation.dll + + + $(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Windows8\SharpDX.XAudio2.dll + + + + + ExampleGame.cs + + + ExampleProgram.cs + + + + + + Designer + + + Assets\goblins-ffd.atlas + + + Assets\goblins-ffd.json + + + Assets\spineboy.atlas + + + Assets\spineboy.json + + + + + Assets\goblins-ffd.png + + + Assets\spineboy.png + + + + + + + + + + + + {8e5baee2-8ccc-4a32-8bcf-5ff438056c0e} + SpineMonogameWindows8Store + + + + 11.0 + + + + \ No newline at end of file diff --git a/spine-monogame/windows8-store/example/spine-monogame-example.sln b/spine-monogame/windows8-store/example/spine-monogame-example.sln new file mode 100644 index 000000000..62fb47d4f --- /dev/null +++ b/spine-monogame/windows8-store/example/spine-monogame-example.sln @@ -0,0 +1,64 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "spine-monogame-example", "spine-monogame-example.csproj", "{0A121D95-0803-47DC-B839-FF76AE8F7E7F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpineMonogameWindows8Store", "..\src\SpineMonogameWindows8Store.csproj", "{8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|ARM.ActiveCfg = Debug|ARM + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|ARM.Build.0 = Debug|ARM + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|ARM.Deploy.0 = Debug|ARM + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|x64.ActiveCfg = Debug|x64 + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|x64.Build.0 = Debug|x64 + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|x64.Deploy.0 = Debug|x64 + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|x86.ActiveCfg = Debug|x86 + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|x86.Build.0 = Debug|x86 + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Debug|x86.Deploy.0 = Debug|x86 + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|Any CPU.Build.0 = Release|Any CPU + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|Any CPU.Deploy.0 = Release|Any CPU + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|ARM.ActiveCfg = Release|ARM + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|ARM.Build.0 = Release|ARM + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|ARM.Deploy.0 = Release|ARM + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|x64.ActiveCfg = Release|x64 + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|x64.Build.0 = Release|x64 + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|x64.Deploy.0 = Release|x64 + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|x86.ActiveCfg = Release|x86 + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|x86.Build.0 = Release|x86 + {0A121D95-0803-47DC-B839-FF76AE8F7E7F}.Release|x86.Deploy.0 = Release|x86 + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Debug|ARM.ActiveCfg = Debug|ARM + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Debug|ARM.Build.0 = Debug|ARM + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Debug|x64.ActiveCfg = Debug|x64 + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Debug|x64.Build.0 = Debug|x64 + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Debug|x86.ActiveCfg = Debug|x86 + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Debug|x86.Build.0 = Debug|x86 + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Release|Any CPU.Build.0 = Release|Any CPU + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Release|ARM.ActiveCfg = Release|ARM + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Release|ARM.Build.0 = Release|ARM + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Release|x64.ActiveCfg = Release|x64 + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Release|x64.Build.0 = Release|x64 + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Release|x86.ActiveCfg = Release|x86 + {8E5BAEE2-8CCC-4A32-8BCF-5FF438056C0E}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/spine-xna/example/src/ExampleGame.cs b/spine-xna/example/src/ExampleGame.cs index 97140d5cd..9fa8ae3dd 100644 --- a/spine-xna/example/src/ExampleGame.cs +++ b/spine-xna/example/src/ExampleGame.cs @@ -49,6 +49,12 @@ namespace Spine { AnimationState state; SkeletonBounds bounds = new SkeletonBounds(); +#if WINDOWS_STOREAPP + private string assetsFolder = @"Assets\"; +#else + private string assetsFolder = "data/"; +#endif + public Example () { IsMouseVisible = true; @@ -71,10 +77,10 @@ namespace Spine { // String name = "spineboy"; String name = "goblins-ffd"; - Atlas atlas = new Atlas("data/" + name + ".atlas", new XnaTextureLoader(GraphicsDevice)); + Atlas atlas = new Atlas(assetsFolder + name + ".atlas", new XnaTextureLoader(GraphicsDevice)); SkeletonJson json = new SkeletonJson(atlas); if (name == "spineboy") json.Scale = 0.6f; - skeleton = new Skeleton(json.ReadSkeletonData("data/" + name + ".json")); + skeleton = new Skeleton(json.ReadSkeletonData(assetsFolder + name + ".json")); if (name == "goblins-ffd") skeleton.SetSkin("goblin"); // Define mixing between animations. @@ -146,19 +152,27 @@ namespace Spine { } public void Start (AnimationState state, int trackIndex) { +#if !WINDOWS_STOREAPP Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": start"); +#endif } public void End (AnimationState state, int trackIndex) { +#if !WINDOWS_STOREAPP Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": end"); +#endif } public void Complete (AnimationState state, int trackIndex, int loopCount) { +#if !WINDOWS_STOREAPP Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": complete " + loopCount); +#endif } public void Event (AnimationState state, int trackIndex, Event e) { +#if !WINDOWS_STOREAPP Console.WriteLine(trackIndex + " " + state.GetCurrent(trackIndex) + ": event " + e); +#endif } } } diff --git a/spine-xna/example/src/ExampleProgram.cs b/spine-xna/example/src/ExampleProgram.cs index 88f805fc8..4ee5042cf 100644 --- a/spine-xna/example/src/ExampleProgram.cs +++ b/spine-xna/example/src/ExampleProgram.cs @@ -11,5 +11,17 @@ namespace Spine { } } } +#elif WINDOWS_STOREAPP + public static class Program + { + /// + /// The main entry point for the application. + /// + static void Main() + { + var factory = new MonoGame.Framework.GameFrameworkViewSource(); + Windows.ApplicationModel.Core.CoreApplication.Run(factory); + } + } #endif } \ No newline at end of file