Open-source implementation of Microsoft's XNA 4, for Windows, Mac, Linux, Android, and iOS, among others.

learn more… | top users | synonyms

0
votes
0answers
18 views

How can library classes access SpriteBatch?

I have a spritebatch in my primary game component in a game project: public class GameRoot : Game { private SpriteBatch mySriteBatch; public SpriteBatch MySpriteBatch { get { return ...
0
votes
1answer
61 views

Different game resolutions on emulator and on a real device (which has the same resolution) on Windows Phone 8

I have a big problem with game resolution, when I'm running my game on emulator (which theoretically has the same resolution as my real windows phone device: 800 x 480). I'm making the game with ...
0
votes
1answer
31 views

Mode 7 in xna/monogame

I want achieve a view like Mode 7 from snes games where the closer textures get stretched out more and more far away textures look smaller. Something like this: What I have in my project at the ...
3
votes
1answer
58 views

Problems with converting from Screen Space to World Space

I have an unproject function I've written, which takes in x and y values between -1 and 1, and a z value between 0 and 1 (0 is near plane, 1 is far plane). I create a vector off of this, and multiply ...
0
votes
0answers
26 views

Difficult to implement Microsoft XNA Platformer Example Enhancement

I implemented the platform logic from the XNA Platformer Example, but it have few annoying bugs, like this one: I wasn't able to fix it by myself, so I searched a lot and found this question: ...
0
votes
2answers
83 views

Best way to draw 2D shapes on a 3D flat object

I want to draw shapes (arcs, circles, lines) on a table, which is in 3D space. The table top is at Y=0 level and oriented so it points to (0, 1, 0). There are some other 3D objects on the table, so ...
1
vote
0answers
22 views

Farseer Engine Texture To Polygon Center of mass bug

I am new to Farseer Engine used with MonoGame so I decided to do some test with the API to see the results and learn. If I understand, in Farseer the Position property of a Body object is located at ...
0
votes
1answer
147 views

Monogame / XNA - Multple 2D Cameras (Rectangle) on screen

I recently started building a simple 2D roguelike game using Monogame 3.4. I was keen on building the game "engine" myself as I saw it as a fun learning curve. Monogame was pretty much the best option ...
2
votes
2answers
93 views

Draw 3D ellipse in monogame/xna

I am programming a 3d solar system (simulator). To describe the path of a planet I wanted to add 3D rectangles.. and draw them. But this ; no surprise; decreased the frame rate extremly. Also it does ...
1
vote
1answer
48 views

Monogame scale/resizing texture without stretching the borders

I would like to scale or resize my texture2d but when I do it, the texture border becomes stretched. Here's an example : This is my original texture And this the texture after I change the Scale: ...
1
vote
2answers
120 views

Can I make this physics simulation any faster?

I've made a little real time physics simulation that solves some bodies. CirclevCircle && CirclevOrientedRect I would like someone to tell me if I'm doing something drastically wrong. I know ...
1
vote
1answer
58 views

How to fix my camera collision, C# XNA

I am having some weird issues with my camera. I am trying to make it so it is a first person camera, that when the user presses the W or Up key, it moves towards where the camera is looking. My issue ...
0
votes
2answers
78 views

Is it possible to trigger a loop with key input

Ok I need to know if it is possible to trigger a gameloop with a key press? ex code if (GamePad.GetState(PlayerIndex.One).Buttons.X == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Up)) ...
0
votes
0answers
14 views

Writing a VB Template

As I'm having all these problems with Fonts and Sounds basically not working at all in the XNA template I found for VB, I'm thinking of trying to convert over to Mono. So, two questions I suppose; ...
2
votes
2answers
85 views

Touch taps only on very short flicks on Win7 with Monogame

I have an application on win7 which needs to support touch and mouse input using monogame. But reading touch taps proves to be a very hard thing. The TouchPanel is initialized like this: ...
1
vote
1answer
67 views

Problem disposing content from a screen's content manager

I have a problem with my game. I am using multiple classes for different screens, for exemple: Main Menu is one screen, When playing is another, and so on... I decided to use multiple ...
1
vote
1answer
131 views

Black Rectangle instead of texture

I am trying to draw a textured ractangle like in this example. But instead of a texture the rectangle is just black. Draw method: protected override void Draw(GameTime gameTime) { ...
2
votes
1answer
158 views

Supported Orientation, Monogame, Windows Phone 8

I am developing a game in which I need to rotate the screen on Landscape mode or Portrait, and lock it that way. In Monogame, targeting Windows Phone 8.1 adding this code: ...
7
votes
2answers
207 views

2D A* Path-Finding

I have this problem, which isn't really a problem, but I feel like it's some sort of glitch in my code maybe. My pathfinder, to find a path from A to B, does this: which is almost fine, it works ...
0
votes
0answers
17 views

Error loading MonoGame Fonts

I'm getting to the end of transposing the MonoGame Asteroids tutorial app to VB, all going very well until I got to the font. I would assume the VB Syntax would be myFont = Content.Load(Of ...
1
vote
1answer
23 views

MonoGame, sprite to rectangle

I'm bucking the trend and working with MonoGame in VB2015, please don't tell me how brilliant C# is and how I ought to learn that, I really can't be bothered, and all the }}{}{{{}{ drives me insane!! ...
2
votes
1answer
74 views

In unity 5 export package is not working correctly

I am using unity 5. I Created an objects with layer names. I tried to export a package. After Exporting, i import the package in new project and ran the project its not working. observed that objects ...
4
votes
2answers
55 views

Monogame project runs in VS but hangs when run via .exe

I've been working on a monogame project for a little over a week and had no problems. Today I went to test out the project outside of Visual Studio, by running directly from the .exe in the release ...
3
votes
1answer
61 views

How can i convert non-canvas mesh collider object as canvas mesh collider object

I am new to unity i created a character object in Maya and stored it as char.obj, then i import the object in unity. the char1 object is not colliding with any other unity objects like cube, plane, ...
1
vote
1answer
147 views

Modularization in a project

I'm writing a C# game in Mono, and I want the game to be as modular as possible. I've started by writing the whole Item (inventory) System of the game in a seperate .dll library But I've hit a ...
0
votes
1answer
187 views

How to get plausible platformer physics with Farseer on MonoGame/XNA?

I am creating a 2D Vectorial (made of polygons, not tiles !) platformer using MonoGame and Farseer Physics Engine. Everything works perfectly, except the movement of the character which doesn't feels ...
0
votes
0answers
19 views

Monogame Vertex Shader Hassle

I'm currently creating a game in Monogame 3.4. I've written a relatively simple pixel shader in HLSL which works perfectly fine under Windows DX. When I use the same shader under Linux (OpenGL), ...
0
votes
1answer
54 views

Rotation Continuity help

First the issue im having: Basically its the fact that the angles of a circle aren't continuous, they rise from 0 to 2pi then immediately fall back to 0. I want to make a game where the player ...
1
vote
0answers
30 views

SignalR Monogame Lag

I'm creating a C# multiplayer game in Monogame using SignalR to update the enemy players positions. This is my proxy.invoke: proxy.Invoke("UpdateEnemy", LocalShip.Position, ...
0
votes
0answers
31 views

Shader that only shows edge of textures and hides rest

I'm wondering if anyone has a name for this type of shader, has an example of how to do it, or can point me in the right direction for creating one. This is a picture of the no shader / wanted ...
4
votes
3answers
2k views

Issue with Monogame resizing

I've converted my XNA project into a MonoGame one. Whenever I start the application and resize the game manually (ie - dragging the window)... this.Window.AllowUserResizing = true; ...the game ...
0
votes
2answers
80 views

Monogame resolution problem (without scaling sprites)

So I'm working on a project and started working on a scaling system for different resolutions. I know if you change the monogame resolutions, that the texture won't scale but I noticed deformed ...
1
vote
1answer
37 views

scaling problem with some resolutions

So I made a scaling system for different resolutions, and I got very weird results. I have an old "scaling" system where you can choose which scaleSize you want (for testing with the old 800 x 450 ...
4
votes
1answer
232 views

How can I make a scrollable text view?

I am trying to do an appication in monogame windows. I have a long text to be displayed on screen. I tried to render it on screen using spriteBatch.Drawstring, was succesful to an extent. But, the ...
0
votes
1answer
35 views

Automapping of the noise texture onto 3D model

I want to apply kind of noise/dust texture to objects so it would look good, and make it without having UV mapping in models. This is because I want to have a possibility to apply this to any objects, ...
3
votes
3answers
65 views

MonoGame - Ordering Movement Key Presses

I'm looking for a way to retrieve the last key pressed even when other keys might be pressed for a top-down four-directional game. For example: W is pressed → Move up D is pressed → Move ...
3
votes
1answer
123 views

new graphicsdevice returning null

I tried to make a collision box visible (for testing) with spriteBatch.Draw(with a blank texture) in my TileSprite class. I needed a GraphicsDevice for this so these are my variables: Texture2D ...
0
votes
0answers
45 views

Custom game loop entirely in the Update method

I am attempting to implement a custom game loop in XNA/Monogame. I know that one can re-implement the Game class using WinForms (with the caveat of having to also redo the content manager, etc.). I ...
0
votes
0answers
23 views

How to use OpenTK (OpenGL) with MonoGame?

So I've been making a snake game using MonoGame (DirectX Only). I added movement, controls, feeding and growing in length. I wanted to add smooth animations to the game because the snake is just made ...
1
vote
0answers
31 views

Can't play sound in Monogame

I'm new in monogame so I have some problem with play sounds in my game. I have a variable: SoundEffect _soundEffect; In LoadContent() method I'm doing this: _soundEffect = ...
1
vote
1answer
37 views

HLSL pixel inside a view (cascaded shadowmapping)

I'm figuring out shadowmapping in HLSL (see also this question). I understand that I need projection matrices for each cascading shadowmap. I use this code to create the projections: Matrix ...
0
votes
1answer
45 views

Monogame - NullReferenceException on Exit();

I'm currently attempting to learn the Monogame system. I have little prior experience in C# (about two weeks of XNA, four years ago) but am reasonably familiar with VB.NET. Essentially, when calling ...
3
votes
0answers
65 views

No collision with CompoundPolygon Monogame/Farseer

I want to create a body based on its texture. But the body I created just falls through the floor instead of colliding and resting on it. My Code: using FarseerPhysics; using FarseerPhysics.Common; ...
1
vote
1answer
66 views

HLSL Shadowmap shader for large scale environments

I'm working on a racing game in Monogame. The game runs fine so far using Monogame's BasicEffect (link to video). I wanted to add shadows so I implemented a shadowmap using this as a base. and a ...
1
vote
1answer
64 views

MonoGame does not generate xnb from png

I am coming straight from XNA and I installed the latest version of MonoGame today (2015-12-22) for Visual Studio 2015 Community. I created a project from the windows Project template. I right ...
1
vote
2answers
112 views

How to restart the game when pressed enter in XNA

If the following code allows the game to exit when pressed esc .. if (gamePad.Buttons.Back == ButtonState.Pressed || keyboard.IsKeyDown(Keys.Escape)) { this.Exit(); } Then this code should ...
0
votes
1answer
30 views

How to draw a sprite at a floating point xy coordinate with interlaced drawing?

I have a 2D game made in MonoGame (XNA 4.0 framework). Here's what I want to do: draw a 2d image at a floating point xy coordinate such as 125.5, 300.12 (and do NOT round them to an int). the image ...
0
votes
1answer
73 views

In Monogame, why does Rectangle.Offset not work?

I have the following code in a default Monogame Game project: protected override void Update(GameTime gameTime) { if (Keyboard.GetState().IsKeyDown(Keys.Left)) { ...
1
vote
0answers
41 views

OpenTK crashes with Mono

I've implemented OpenTK as a secondary renderer which would let me support Mac/Linux only to realize that for some reason, even without any modifications (new MonoGame project), the application would ...
0
votes
0answers
40 views

XNA 2D position offset

I am creating a 2D game engine with XNA and MonoGame. For each of my sprites I have offset positions, which I use to align another sprite if is it not within the main sprite i.e. stance. I have an ...