Questions tagged [xna]

XNA is a game framework by Microsoft that allows deployment for Windows, Windows Phone & Xbox 360.

Filter by
Sorted by
Tagged with
0 votes
1 answer
50 views

Is there a simple way to find where our code is keeping references to disposed/pooled objects?

In our c# game we use object pools to store sprites once the Dispose() method gets called.Then when the Sprite.Create method gets called if a sprite is in the pool it gets depooled, cleared and ...
Matteo's user avatar
  • 15
0 votes
0 answers
139 views

How to make 3D particles in Monogame?

I have made a 2D game and right now I am converting it to a 3D game. All fine so far, only for the particles I had used the particles library from monogame extended but this library only supports 2D ...
codymanix's user avatar
  • 364
0 votes
1 answer
177 views

Apply bloom effect to RenderTarget without affecting UI

I'm currently rendering my whole game to a RenderTarget in order to stretch the scene to any resolution. I also have a bloom effect rendered with the scene. I'm now ...
Syll's user avatar
  • 11
0 votes
1 answer
319 views

Drawing Textured Quads

I've been starting to write some XNA / Monogame code lately, and wanted to draw a quad with a Texture2D attached to it. After searching the internet for a while, I've come up with this render code: <...
Mickey's user avatar
  • 1
0 votes
1 answer
44 views

Rotate and Zoom a group of tiles

I'm working on a tile-based game and I'm trying to rotate my tiles as a group around the center of the screen and want to have the ability to zoom in and out. Here my code: ...
Canox's user avatar
  • 103
1 vote
1 answer
123 views

Best way to draw a tile (a floor) all over the screen?

I wanted a tip, a guidance perhaps to know the best way to draw a tile all over the screen. This tile is a 16x16 tile that should be the floor in my top-down map. I set my resolution to 1280x720 and i ...
Gabriel Ozzy's user avatar
1 vote
1 answer
68 views

Meshes seem to get distorted when I use rotate or zoom transforms (XNA/Monogame)

Whenever I seem to create a rotation matrix or try to zoom, the meshes that I draw to the screen get stretched and distorted. I've tried to make a simple rotation matrix like this: ...
Lukas Kawalec's user avatar
3 votes
1 answer
173 views

Proper way to build sensible object graphs?

The Context I'm currently working on a game and its engine using C# and MonoGame. The engine is data-driven and I want people to be able to mod the game or make their own using my engine. All the ...
sboutin4's user avatar
2 votes
1 answer
276 views

Floats vs. Ints for position and collision

So I’m writing a player class and using floats to store the positon and velocity (Vector2) as well as using it when drawing. When it comes to collision I get the player bounds using this code: ...
gamer1's user avatar
  • 65
0 votes
0 answers
155 views

How to mask 2D tile sprites

I want to use masking technique to be able to reuse tiles. Basically I have the base texture and an array of masking textures for different corners and positions and want to combine the two to get a ...
gamer1's user avatar
  • 65
0 votes
1 answer
1k views

Something goes wrong when using System.Diagnostics.Process.Start to open a Monogame project

I am trying to develop a menu application for a homemade arcade. However, when I use Process.Start(path) to open my monogame projects' ...
DubstepZedd's user avatar
0 votes
0 answers
142 views

Basic Projection & View matrix

Currently writing a camera component for FNA (basically XNA), and can't for the life of me figure out why my matrix transform isn't working as expected. This is how I calculate my view & ...
Charanor's user avatar
  • 7,800
0 votes
1 answer
236 views

How to handle objects on 2D Map

I am making a 2D RPG game in Monogame XNA. For the moment I have 2 kinds of data in my game: sprites objects and tiles. All the sprites are contained in a array list. I iterate over the sprites ...
Nyonx's user avatar
  • 1
0 votes
1 answer
273 views

How to do topdown collisions properly?

I'm trying to achieve grid/tile based collisions like "a link to the past"; here is an article showing it off (sliding off the corners and such). I'm currently using this type of collision ...
MysteriousFruit's user avatar
0 votes
1 answer
112 views

How can I find the direction a sprite is moving?

I'm trying to get the direction a sprite is moving (up, down, left, right). My current approach is to get the x and y coordinates of the target and the sprite (the sprite is the thing that I'm trying ...
Beanicles's user avatar
0 votes
1 answer
674 views

Window handle is invalid

I'm trying to implement an input listener for FNA (modern version of XNA). Since FNA does not supply any sort of way to listen to native input this has to be done through the windows API and native ...
Charanor's user avatar
  • 7,800
0 votes
1 answer
180 views

How to select a sprite with the mouse in c# XNA?

I'm attempting to create a chess game, for the movement I need to be able to click on a piece with the mouse, and then the square I'd like to move it to. Each piece on the board is a sprite, and I'm ...
jriley's user avatar
  • 1
0 votes
3 answers
172 views

How do I show only the level in monogame? [closed]

How do I remove the blue background shown here So that only the level is visible without making the sprites/map larger or the window smaller?
LionCatDev Studio's user avatar
0 votes
1 answer
85 views

XNA configuration on legacy code

Background: Our biomechanics and Advanced Surgical Technologies Lab wrote a surgery navigation system desktop application in C# around ten years ago. One of its major functions uses XNA Game Studio 4....
user avatar
1 vote
0 answers
170 views

Matrix transforming with translation/rotation/scale at center of screen

I'm trying to create a camera using matrix transforms, the gist is as follows: ...
Pooper's user avatar
  • 23
0 votes
0 answers
69 views

how to order entities by their distance from 0 on the x axis

I'm creating an infinite runner game in which you control several characters at once. Right now when you press the spacebar, they all jump at once but, I want them to jump at separately, one after ...
yasko kai's user avatar
0 votes
1 answer
47 views

Complex mesh (created in Blender) is not overlapping when rendered in Monogame (XNA)

community. Just started playing with Monogame and stuck with a quite simple, but still unanswered issue, at least I couldn't find any answer. The model rendered in Monogame (XNA) is not overlapping ...
LaoR's user avatar
  • 101
0 votes
0 answers
63 views

How do I export an XNA crossplateform project to Nintendo 3ds or Nintendo Switch? [duplicate]

I would like to document my self a bit about 3ds and switch game creation. I know that modern game engine have builtin tools to export games to these platforms, but I could not find - in google ...
Louis BERTRAND's user avatar
2 votes
1 answer
355 views

Getting Rendered Sprite Size

I need the rendered dimensions of a sprite, I'm calling Draw in the class below: ...
mxmissile's user avatar
  • 131
2 votes
1 answer
145 views

Frame-rate drops when drawing 2D map tiles

Update: I figured out it has nothing to do with the camera but instead framerate drops when drawing my map tiles onto the screen. Here’s a link to a video showcasing the bug in action (For further ...
TheCo's user avatar
  • 21
0 votes
1 answer
86 views

Game() parametters Content and Window are not pre initialized

I've been experiencing a really Strange problem since recently, Every variables of XNA Framework Game class seems not to be initialized before my extending Game1 class. Variables does not seem to be ...
Louis BERTRAND's user avatar
0 votes
0 answers
468 views

Playing Video for Splash screens etc using Monogame

I've been searching around on internet a way to display a video using XNA/Monogame. But everything tend to go in the direction of the class Microsoft.XNA.Framework.Media.Video. Unfortunatly, my xna ...
Louis BERTRAND's user avatar
0 votes
1 answer
267 views

How to flip a rectangle

I'm curently working on a system that make the player character look towards the mouse pointer. My system is effective but i'm having an issue while displaying the rectangle. In the Following code i ...
Louis BERTRAND's user avatar
0 votes
1 answer
198 views

Check if point is inside convex hull

I first tried with a simple axis aligned bounding box to test my algorithm (later shape will be different but always convex 6 faces), but even this case did not work, it always tells me that the point ...
codymanix's user avatar
  • 364
0 votes
3 answers
618 views

XNA Rotate Vector2 around Origin

I have a Rectangle and a Vector2 position, my sprite is being drawn at this position. The rectangle is meant to be a collision system with the cursor, when I rotate my sprite around the origin and ...
vK31RON's user avatar
1 vote
2 answers
683 views

Monogame - SpriteFont Exception: Text contains characters that cannot be resolved by this SpriteFont

I'm trying to put text on the screen and if I put anything but an empty string I get "Text contains characters that cannot be resolved by this SpriteFont.\nParameter name: text" ...
Kyle Johnson's user avatar
0 votes
0 answers
347 views

Sprite Distortion (Ghosting While Moving and Artifacts when Mirroring to External Display)

I am working on my first MonoGame project. I love the framework so far! I have implemented my own letterbox/pillarboxing to scale my native resolution by the maximum integer scale allowable on my ...
DyingIsFun's user avatar
  • 1,307
2 votes
1 answer
305 views

Sprites looks blurried on fullscreen

I'm trying to make a pixel art game and my resolution is 384 x 224, but when I change to fullscreen the sprites looks blurry and I don't know how I can disable bilinear filtering. I tried ...
Gianqui's user avatar
  • 21
0 votes
0 answers
64 views

HLSL Xna Deferred light issue

My point lights seem to have problems when the camera is far away… is it the depth map? Anyway i'll show you the code Here is my GBUffer fx : ...
David Neves's user avatar
0 votes
0 answers
189 views

HLSL : Offset and length were out of bounds

...
David Neves's user avatar
0 votes
1 answer
41 views

How to stop movement from moving multiple spaces when a directional key is pressed

I am making a 15 piece puzzle game and having difficulty making my sprite move one tile at a time, when i initially press the left key the sprite moves once, but after that the sprite moves multiple ...
Timer's user avatar
  • 1
1 vote
1 answer
2k views

Monogame/XNA - How do you resize a Texture2D and then scale it?

Problem: It seems like the Draw() call allows us to use either Destination Rectangle for resizing (5of8) or Scale (6of8/7of8) but not both. Purpose: I would like to resize a button from 567x634 to ...
spirits's user avatar
  • 21
1 vote
0 answers
38 views

How do I change a specific set of spawned buttons from gray to green?

I'm a self-taught programmer. I have a button class runs like this: ...
spirits's user avatar
  • 21
0 votes
2 answers
566 views

How would you go about placing objects between chunks in a 2D game?

I have a 2D infinitely generated world which is split up into 9 chunks at a time. Three chunks are loaded and three are unloaded whenever a player moves into a new chunk (if the player moves up a ...
propellerhat23's user avatar
2 votes
1 answer
515 views

MonoGame game running slowly

Through development I've been running my 2D game (Monogame 3.6) on my windows laptop, which has some crummy integrated graphics card and an i5. Now I try my game on my gaming PC, which has a GTX 970 ...
JoeText's user avatar
  • 43
1 vote
1 answer
442 views

Monogame - Collision not working and invisible walls

I have recently been experimenting with Monogame and XNA (moving from Gamemaker) and decided to work on a simple collision system. Problem is shown in the GIF. Main Collision Each entity (Quick name ...
Dovydas Vaičiukynas's user avatar
0 votes
0 answers
178 views

How can I make the screen scroll only when the character is close to the edge?

On the internet, I saw videos and tutorials about screen scrolling. But those only show how to keep the player always in the center of the camera. I want my camera to scroll over the level, following ...
Karol's user avatar
  • 121
1 vote
0 answers
616 views

Implementing a scrollable Panel in XNA/MonoGame

I am trying to create a scrolling Panel for my game. The code I've shown below works but there is a problem. I read Andrew's answer here and decided to implement the scrolling effect by using a ...
Johny P.'s user avatar
  • 113
1 vote
1 answer
191 views

How to add a animation to myPlayer

I'm currently making a shoot em up in monogame. I want to add just one animation to my object. No commands or transitions between animations for different actions: just an object swapping between ...
Guest1234's user avatar
0 votes
1 answer
90 views

Blender export does not render correctly in Monogame

I am using Monogame 3.7.0.7 on Linux and Blender. I have exported my model using the "FBX 7.4 Binary" exporter. Here is a render from Blender: However, when ...
sdgfsdh's user avatar
  • 275
1 vote
1 answer
351 views

Collision detection problem in monogame C#

...
Karol's user avatar
  • 121
1 vote
1 answer
277 views

My position is "changing" when handling animation

I'm trying to learn Monogames(Old XNA) and how to develop a 2d game. I'm in the process of animating my sprites. It works but there are somethings that are weird to me. For some reason when ...
tirri's user avatar
  • 31
1 vote
1 answer
69 views

Why isn't my vertical scrolling functioning properly?

I'm trying to make a simple 2D platformer in XNA, but I'm having trouble with the vertical scrolling. What I'm trying to accomplish is that whenever the player is above half the height of the screen,...
MHK's user avatar
  • 11
0 votes
1 answer
326 views

How can I do a Metroid like transition between two tilemaps with Monogame Extended?

I want to do a transition like those in the Metroid games. Here is an example of what i mean: https://www.youtube.com/watch?v=RKJ3MAi0ZI0. You enter the door, the screen fades to black and the camera ...
Ultralord's user avatar
0 votes
1 answer
158 views

How to check if a custom Control is focused?

So I am building custom UI for my MonoGame project. I've gotten pretty far already, having created Controls such as: Button Panel TextBox Form ComboBox CheckBox etc. All of these controls obviously ...
Johny P.'s user avatar
  • 113

1
2 3 4 5
62