monogame

Sound not working in iOS for iPad

蓝咒 提交于 2019-12-11 09:49:44
问题 My game works fine in the simulator and on an actual iPod Touch device, but when I run it on my iPad 2 device the sound doesn't play and the sound effects don't play. Here is my code to start up the background music. Keep in mind this works on the simulator AND on an actual iPod Touch device: SoundEffect.MasterVolume = 1.0f; SoundEffect soundMusic = (new ContentManager(screenManager.Game.Services, "Content")).Load<SoundEffect>("Music"); SoundEffectInstance soundMusicInstance = soundMusic

MvvmCross - MonoGame

若如初见. 提交于 2019-12-11 03:36:51
问题 I'm trying to build a MonoGame view inside MvvmCross on Android,iOS and WP8. On Windows side it's relatively easy to use dependency properties as a binding target, but how can I achieve a cross platform data binding solution that I can use on all platform? 回答1: This was covered in a previous MvvmCross version - see Insert a Monogame view inside MvvmCross monodroid Activity The technical details have changes a bit since that post, but the core of the advice remains the same - use inheritance

NullReferenceException when creating instance of Game class (OpenTKGameWindow.Initialize)

天涯浪子 提交于 2019-12-11 02:47:13
问题 I just installed xamarin and monogame on OSX I have tried to run a really basic demo project that works perfectly on windows. But I get the following error: System.NullReferenceException: Object reference not set to an instance of an object at Microsoft.Xna.Framework.OpenTKGameWindow.Initialize () [0x00000] in <filename unknown>:0 at Microsoft.Xna.Framework.OpenTKGameWindow..ctor () [0x00000] in <filename unknown>:0 at Microsoft.Xna.Framework.OpenTKGamePlatform..ctor (Microsoft.Xna.Framework

Convert 2 vector2 points to a rectangle in xna/monogame

▼魔方 西西 提交于 2019-12-11 01:40:07
问题 I have some code which will detect the start and end point of a click-and-drag action, and will save it to 2 vector2 points. I then use this code to convert: public Rectangle toRect(Vector2 a, Vector2 b) { return new Rectangle((int)a.X, (int)a.Y, (int)(b.X - a.X), (int)(b.Y - a.Y)); } The code above does not work and googling, so far has come up inconclusive. Could anyone please provide me with some code or a formula to properly convert this? Note: a vector2 has an x and a y, and a rectangle

Cannot modify the return value of

馋奶兔 提交于 2019-12-11 01:26:37
问题 I'm new at C# so, sorry in advance if this question is a bit silly, I get a error when i try to run the program. From visual Studio 2012 I got this error message "Cannot modify the return value of 'GameName1.Cartman.Position' because it is not a variable" 2 times, on line 30 and 31. I hope some one can help me with this. here is the code: using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; using System.Linq; using System.Text;

Using a BMP image as font in Monogame

三世轮回 提交于 2019-12-10 21:36:59
问题 Is there a way to load a custom font using a BMP image.. I have seen a solution online by Microsoft providing this, but i keep on getting content-load exception when trying to run this solution. It seems like this used to work with XNA but might not be the case anymore with Monogame. I want my own custom font, since this font won't be pre-installed on the computer of the client. I already looked at XNB files from SpriteFont Converter, and that is not the solution i wish to aim for. Any help

Monogame and .fx files?

断了今生、忘了曾经 提交于 2019-12-10 09:44:36
问题 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

Android API IsConnected returning TRUE after Signing Out

喜你入骨 提交于 2019-12-09 11:02:40
问题 I am developing a game for Android using Google Play Game Services, using Xamarin. I am doing my testing using a Genymotion Android Emulator. I have run into an issue that appears to be a bug in either Google Play or Xamarin's implementation. If I sign out of a Google account , calls to the IGoogleApiClient.IsConnected() continue to return true (even though I have clearly just signed out). If I then attempt to use that API object, I will get exceptions like: java.lang.SecurityException: Not

How can i install MonoGame into Visual Studio 2013?

北城以北 提交于 2019-12-09 07:24:49
问题 How can I install MonoGame templates for Visual Studio 2013 ? 回答1: Assuming you want C# templates: Install MonoGame from here Find the Visual Studio templates folder (usually C:\Users[your user name]\Documents\Visual Studio 2012\Templates\ProjectTemplates\Visual C#) Copy the MonoGame folder to the Visual Studio 2013\Templates\ProjectTemplates\Visual C# folder. 回答2: UPDATED 7 January 2014 For people who want to use Monogame can download the 3.2 which provide the support for 2013. The installer

Constant Visual Studio Update Required popup for Monogame 3.4 and Windows 10 UAP project

穿精又带淫゛_ 提交于 2019-12-08 19:38:37
问题 So, I’ve been trying to launch Monogame template on Windows Phone emulator with Visual Studio, but I couldn’t get it work. This is what I have tried: In my project I have encountered a problem with creating a Monogame project for Windows UAP in Visual Studio. I have tried to create a project with a Wizard tool, but after project creation I got the message that I need to install Universal Platform Tools see picture number 1 after I pressed Install button an error has occurred see picture