monogame

MonoGame / XNA Draw Polygon in Spritebatch

只愿长相守 提交于 2020-04-11 05:02:07
问题 i am currently writing a game with MonoGame and I need to draw textured shapes. I want to draw polygons with 4 corners. All my renderstuff is done with the spritebatch. I tried to use TriangleStripes, but it does not work very well for me, because I don't have any experience with shaders and mixing this with the rest of the spritebatch-rendercode seems complicated. One solution i thought about was to draw a quad and strech the texture with texturecoordinats. Is this possible somehow? I can't

A* Algorithm 2D Game Pathing issues

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-24 11:22:06
问题 I have decided to pick up my old 2D game engine from back in the day and continue work on it This is my first attempt at trying to implement some basic AI for enemies and I am having some issues. Here is a run down on how I am treating the AI for enemies. If the player is within a certain range of the enemy, the enemy moves towards the player by just checking to see if he is up or down, left or right of the player and adjusting it's Coordinates accordingly. If the enemy hits an obstacle that

Monogame Ambiguous Vector2

痞子三分冷 提交于 2020-01-16 05:08:04
问题 I am having an issue where I keep getting ambiguity errors between Monogame and XNA libraries. No matter what I do, I cannot get it to compile. I have removed XNA off my computer and yet the error still persists. The full error is: Error 4 Argument 1: cannot convert from 'Microsoft.Xna.Framework.Vector2 [c:\Program Files (x86)\MonoGame\v3.0\Assemblies\WindowsPhone\x86\MonoGame.Framework.dll]' to 'Microsoft.Xna.Framework.Vector2' on lines such as: EngineGlobal.world = new World(new Vector2(0,9

Monogame XNA transform matrix for a single object?

落爺英雄遲暮 提交于 2020-01-15 12:38:12
问题 I have read a few tutorials explaining transform matrices for XNA/Monogame. The problem is that these matrices are applied to SpriteBatch.Begin(...matrix); This means that all Draw code will be transformed. How do I apply a transformation matrix to a single drawable object? In my case I want to transform a scrolling background so that it automatically wraps. SpriteBatch.Draw(.. this has no transform matrix parameter?); 回答1: If you want to use a specific spritebatch begin call for some drawing

Can't Load asset as XML file

限于喜欢 提交于 2020-01-11 13:56:18
问题 I have done my project with XNA and I'm currently trying to convert it while using Monogame. My problem is that i can't load my XML file. the error: Could not load Level asset as a non-content file! My code: file = Content.Load<XmlData[]>(path); Path = xml name file without extension. (i tried both). class XMLData : public class XmlData { public int id; public int posx; public int posy; public int rot; public int Width; public int Height; } and some of my XML file: <?xml version="1.0"

Cannot load music file

柔情痞子 提交于 2020-01-06 10:18:31
问题 I put the music(mp3) file in the music folder and created a Song song; object in the game class. Then I did song = Content.Load<Song>("music file name here") in the ContentLoad method and did MediaPlayer.Play(song) . But it gives me an error saying: Could not load music asset I tried making the "Copy to Output Directory" to "Copy always". But this also didn't solve the problem. I heared about monogame not having a content pipe line, but I don't understand what it is. Can anyone explain what I

Admob WP8 System.UnauthorizedAccessException

心不动则不痛 提交于 2020-01-04 06:35:15
问题 I am developing a WP8 app using VS2012. I wish to add Admob banner ads, unfortunately it is raising an exception which is causing my app to freeze. To catch this admob exception, I had to disable 'Just my code' VS2012 setting, and after executing the following code, I get a 'System.UnauthorizedAccessException: Access is denied' at the last line. _adControl = new AdView { Format = AdFormats.SmartBanner, AdUnitID = "ca-app-pub-31231-FAKE-FAKE-FAKE" }; _adControl.VerticalAlignment =

Monogame: WAV not playing

时光毁灭记忆、已成空白 提交于 2020-01-03 19:14:31
问题 This is MonoGame 3.4 and I'm using it through VS2013. I'm compiling my WAV file using mgcb the same way as my textures. MGCB works fine, but when it comes to playing a sound using SoundEffect class, it doesn't play anything. There is no exception and SoundEffect.Play() function returns true , but I can't hear anything. Here's my code: Loading: JumpSound = content.Load<SoundEffect>("SpinJump"); Playing: var Ins = JumpSound.CreateInstance(); Ins.Volume = 1f; Ins.Play(); The very same code plays

Drawing Bezier curves in MonoGame (XNA) produces scratchy lines

≯℡__Kan透↙ 提交于 2020-01-02 05:18:35
问题 I recently got into using MonoGame, and I love the library. However, I seem to be having some issues with drawing bezier curves The result that my code produces looks something like this Look bad, no? The lines aren't smooth at all. Let me show you some of the code: //This is what I call to get all points between which to draw. public static List<Point> computeCurvePoints(int steps) { List<Point> curvePoints = new List<Point>(); for (float x = 0; x < 1; x += 1 / (float)steps) { curvePoints

How do I add MonoGame project templates to MonoDevelop on MacOS?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 08:47:05
问题 According to the readme, I am supposed to Shutdown MonoDevelop Find your MonoDevelop AppBundle Right Click on it and select "Show package Contents" Press Alt and Drag and Drop the directory MonoDevelop.MonoGame.2.5 into ../Contents/MacOS/lib/monodevelop/AddIns/ Which I did - but I still don't see the project templates in MonoDevelop. I also looked at these other questions here, here and a few more on google - but didn't find that anyone got the templates to work (most of them used workarounds