monogame

Workaround for Texture2D.GetData method

若如初见. 提交于 2019-12-06 02:33:42
问题 I’m converting a game from XNA to iOS with Monogame. In the code snippet below, smallDeform is a Texture2D on which I call the GetData method. smallDeform = Game.Content.Load<Texture2D>("Terrain/..."); smallDeform.GetData(smallDeformData, 0, smallDeform.Width * smallDeform.Height); I’m having some problem with Monogame because the feature in iOS has not been implemented yet because it returns this exception. #if IOS throw new NotImplementedException(); #elif ANDROID I tried to serialize the

Monogame and .fx files?

徘徊边缘 提交于 2019-12-06 01:26:10
I'm currently following this tutorial but using MonoGame : http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series1/Terrain_from_file.php As said in the tutorial, my main goal is to render a terrain from an image file. There is a .fx provided with the tutorial which I included in my project. I had some issues using MonoGame to load the bmp file for example and now I managed to load it. The problem comes now from the fx file. MonoDevelop tells this : The MGX File is Corrupt ! Here is the original code from the writer of the article : effect = Content.Load<Effect> ("effects"); And here is how I

MonoGame application says SDL.dll is missing, even though it's there. Why?

試著忘記壹切 提交于 2019-12-05 14:31:27
I have a MonoGame application built using the Linux Game template in Visual Studio. It runs on Windows using either .NET or Mono, but it fails on Linux. The error is a DllNotFoundException concerning SDL.dll but the SDL.dll is always in the binary's directory. The file is not a CLR assembly, so it's not in the References. Instead, I have it copied during build from MonoGame's Assemblies/Linux directory (and all related CLR assemblies are copied from that folder as well). The error appears regardless of whether I've built the project under Windows in Visual Studio or Xamarin Studio or under

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

混江龙づ霸主 提交于 2019-12-05 09:00:32
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 value '@drawable/common_signin_btn_icon_disabled_focus_light'). No resource found that matches the given

MonoGame reading touch gestures

房东的猫 提交于 2019-12-05 08:18:31
I am currently writing a game using the fantastic monogame framework. I am having trouble reacting to touch input correctly. When a user drags horizontally or vertically I want to perform an action once per drag. The problem is the gesture is getting issued multiple times for each drag. Here is my code: var gesture = default(GestureSample); while (TouchPanel.IsGestureAvailable) gesture = TouchPanel.ReadGesture(); if (gesture.GestureType == GestureType.VerticalDrag) { if (gesture.Delta.Y < 0) return new RotateLeftCommand(_gameController); if (gesture.Delta.Y > 0) return new RotateRightCommand(

Ambiguous reference between MonoGame & Microsoft.XNA.Framework namespaces

有些话、适合烂在心里 提交于 2019-12-05 08:17:41
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.dll references within the .csproj that my MonoGame template has setup to avoid conflicts, which works

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

耗尽温柔 提交于 2019-12-05 07:10:22
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? Grace Feng Is there an equivalent for UWP? You can subscribe the ContentChanged event for the queried storage files. For example: List<string> fileTypeFilter = new List

Switching between Monogame and UIKit

≡放荡痞女 提交于 2019-12-05 06:59:22
I've been searching and searching but can't seem to find a solution that works for what I'm trying to do, and I'm almost at the point where I have to ask if it is even possible. I'm using Xamarin Studio to develop an iOS app. I have a few different screens set up as UIViewControllers and they are working well. The crux of the app, however, is a game and I want to use Monogame as I've used it before and enjoyed working with it. Basically, I have to switch from a UIViewController to the Game class. I am able to do this by simply creating a new Game object and calling Run(), but I can not figure

How to integrate AdMob ads in the latest MonoGame Android (XNA)?

て烟熏妆下的殇ゞ 提交于 2019-12-04 15:02:03
问题 I have spent the last couple days researching AdMob integration for MonoGame Android and so far have not been able to successfully add a banner to the game I just made. All of the answers I have found so far are terribly outdated and none of the examples I found are working in the latest Android APIs. I am using development build #983 of MonoGame 3.2 in Visual Studio. I have tried: using the sample found in this github repo: /CartBlanche/MonoGame-Samples/tree/master/AdMob as well as the

MonoGame Key Pressed String

感情迁移 提交于 2019-12-04 14:57:28
In MonoGame, how can I read which keyboard key is pressed in the form of a String? I have tried String pressedKey = Keyboard.GetState().ToString(); , but it gives me "Microsoft.Xna.Framework.Input.KeyboardState". In games, you typically think of keys as buttons that have state rather than strings because you are usually checking if a button is up or down to move a character around, shoot, jump, etc. As others have said, you said you should use IsKeyDown and IsKeyUp if you already know what keys you want to test. However, sometimes you just want to know what keys are being pressed. For that,