monogame

Adding content in MonoGame

南笙酒味 提交于 2019-12-08 13:30:53
问题 I'm new to Monogame. I'm trying to add content (An image), but I can't do this. In each tutorial that I have seen, the solution explorer has a folder where I can put assets, but not mine. I tried to add an image to the root folder, but it doesn't work. hero = Content.Load<Texture2D>(@"Image1.png"); 回答1: Right click on your solution and click Add , then New Project . From there, select Installed > Visual C# > Monogame , and click on the MonoGame Content Project After you do this, you will see

Cannot replicate Apple iOS app review crash

喜夏-厌秋 提交于 2019-12-08 09:50:34
问题 I recently submitted my iOS app to Apple for review. It was written in C# using Xamarin iOS, Monotouch and Monogame. I used the Xamarin IDE for development. A week later I get a rejection which specifies the reason being that the app crashes on iPad when the reviewer tries to access the In-App-Purchase store, while on the iPhone 5s it doesn't crash, but indicates that it couldn't reach the Apple servers to retrieve the store items. Much of my store retrieving code is from Xamarin's guide

How to use shaders in MonoGame?

删除回忆录丶 提交于 2019-12-07 19:27:18
问题 Can someone tell me, how to use shaders in monogame? I have this error: https://gamedev.stackexchange.com/questions/46994/has-anyone-got-the-krypton-lighting-engine-working-in-monogame-for-windows-8 I tried to use 2MGFX, but the tool reports: The effect must contain at least one technique and pass. From what I can see from myshader.fx the file, it does. Here is my shader code: sampler TextureSampler : register(s0); float _valueAlpha = 1; float _valueRGB = 1; float4 main(float4 color : COLOR0,

No resource found that matches the given name in common_signin_btn_icon_dark.xml

跟風遠走 提交于 2019-12-07 06:50:20
问题 I am developing a MonoGame app (C#) for Android using Xamarin Android in VS2012. Everything was going well then on a particular build I suddenly started getting 4 similar errors for no apparent reason. These errors all originate from the Google Play component found in the Xamarin component store: No resource found that matches the given name (at 'drawable' with value '@drawable/common_signin_btn_icon_disabled_focus_dark'). No resource found that matches the given name (at 'drawable' with

How can I watch for file changes in a UWP project?

ぃ、小莉子 提交于 2019-12-07 03:38:48
问题 I am porting my game to UWP from the full desktop .net and one thing I need to work out is how to live load texture, shaders etc... into the UWP version of the game. In the desktop version I use a FileSystemWatcher to do this but FileSystemWatcher doesn't exist in UWP, even on directory's that I have full control over. Is there an equivalent for UWP? What is the best way to implement this with the limited set of API's in UWP? 回答1: Is there an equivalent for UWP? You can subscribe the

Ambiguous reference between MonoGame & Microsoft.XNA.Framework namespaces

杀马特。学长 韩版系。学妹 提交于 2019-12-07 03:32:35
问题 MonoGame (a framework which basically brings XNA to Windows Phone 8) has all it's namespaces prefixed with Microsoft.Xna.Framework I believe to minimise the amount of code changes required when porting your XNA app to MonoGame. My issue is, I wish to access the Microphone class, which, because has not been created in MonoGame yet, I have to utilize it from within in the official Microsoft XNA class, this requires taking out the explicit forced removal of the standard Microsoft.XNA.Framework

MonoGame Mac Templates Installation

帅比萌擦擦* 提交于 2019-12-06 14:10:15
I am having trouble installing the MonoGame templates in MonoDevelop on Mac. I have placed the MonoDevelop.MonoGame.2.5 folder in MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/ as instructed by the readme but after restarting monodevlop, the template is not available in the new projects section. Can anyone help with this problem? Mac templates should be available in the 2.5.1 bug fix release, due soon. 来源: https://stackoverflow.com/questions/10508349/monogame-mac-templates-installation

How to use shaders in MonoGame?

懵懂的女人 提交于 2019-12-06 09:27:32
Can someone tell me, how to use shaders in monogame? I have this error: https://gamedev.stackexchange.com/questions/46994/has-anyone-got-the-krypton-lighting-engine-working-in-monogame-for-windows-8 I tried to use 2MGFX, but the tool reports: The effect must contain at least one technique and pass. From what I can see from myshader.fx the file, it does. Here is my shader code: sampler TextureSampler : register(s0); float _valueAlpha = 1; float _valueRGB = 1; float4 main(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0 { // Look up the texture color. float4 tex = tex2D

MonoGame Samples not compiling on Mountain Lion

女生的网名这么多〃 提交于 2019-12-06 09:16:40
So I installed MonoFramework, MonoDevelop and MonoMac and downloaded the latest version of MonoGame. I tried compiling the samples but they all fail with the same error Parsing error of #error Unknown platform . The problem seems to be that for some reason #if MONOMAC and #elif MONOMAC are being ignored. If I remove the Windows, XBOX and Linux related code and get rid of the #if MONOMAC the code compiles and executes. Has there been a change and should I use something else instead of MONOMAC in my platform check (i tried with __APPLE__ and MAC but neither worked). Thank you in advance.

Code runs correctly only when stepping through it with debugger? [duplicate]

时光怂恿深爱的人放手 提交于 2019-12-06 02:52:14
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Random number generator only generating one random number I was a bit baffled with this few moments ago. I have the following code: public blockType generateRandomBlock() { Random random = new Random(); int makeBlockOfType = random.Next(0, 100); blockType t = blockType.normal; if (makeBlockOfType <= 80 && makeBlockOfType >= 60) { t = blockType.blue; } else if (makeBlockOfType > 80 && makeBlockOfType <= 95) { t =