Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 8390

2D refers to two dimensional space where coordinates are represented with X and Y values.

1 vote

How can I improve the performance of handling many objects to draw in XNA?

1) You don't need to calculate the visible objects in a single frame, you may use a bit bigger viewport, and calcultate only 500 objects per frame, if you have 20000 objects and your framerate is 50f …
Blau's user avatar
  • 3,386
1 vote

What's involved in resetting the graphics device?

When you change the size of the xna control... the viewport is changed... so you have to recreate your camera projection matrix.. if you are using spritebatch you should recreate it to initialize t …
Blau's user avatar
  • 3,386
1 vote

Alternatives to multiple sprite batches for achieving 2D particle system depth

Try to render the first batch with SpriteSortMode.FrontToBack and DepthStencilState.Default Then render the particles with SpriteSortMode.Deferred, BlendState.Additive and DepthStencilState.DepthRead …
Blau's user avatar
  • 3,386
3 votes

How do I make a moving object stop smoothly at the end of a path?

You can use XnaTweener that provides easing functions that interpolate values from one point to another in a easy way... Here is a reply with some code based in the Xna Tweener project and a video sh …
Blau's user avatar
  • 3,386
1 vote

What am I missing? (Converting 2D mouse coords to 3D space)

It should be Y=0, if you want to get 2D coords easily, the normal will be Vector3.UnitY If you want to do zoom you should do it by modifying the camera view The Camera.World has not sense, it should be … Normalize(farsourceV - nearsourceV)); var distance = ray.Intersects(plane); if (distance.HasValue) { coords3D = ray.Position + ray.Direction * distance; // if your plane is Y=0, the 2D
Blau's user avatar
  • 3,386
0 votes

How should I calculate world and projection matrices in this scenario?

The world Translation affect object in your world, so usually it will be a simple Translation. But if you want scale, rotation, ... is done this way; Matrix World = Matrix.CreateTranslation(-origin,0) …
Blau's user avatar
  • 3,386
0 votes

What should I use (controls, methods) to make a 2D tile based map editor?

If you can play your levels, you can make the editor ingame... it is not too difficult.. these are two samples one of my tiled games and its ingame editor 1st version ... http://www.yout …
Blau's user avatar
  • 3,386
1 vote

Timer for pop up text in XNA

I'd recommend you to create an specific manager for showing text... To Add a message: MessageSystem.Instance.Show("My string data", Pos, 1); The Class public class MessageSystem { publi …
Blau's user avatar
  • 3,386
2 votes
Accepted

Rotating multiple points at once in 2D

You need to define a center for rotation... in this case the box center.. then when you detect the mouse down you store vector (A) from the center to the mouse coords... this is your initial vector.. …
Blau's user avatar
  • 3,386
2 votes

3d vertex translated onto 2d viewport

The Viewport class has two methods that are very useful for what you want... Viewport.Project and Viewport.UnProject, The UnProject method converts a screen space point into a point in world space, …
Blau's user avatar
  • 3,386
0 votes
Accepted

Storing large array of tiles, but allowing easy access to data

Item is a class, the Tile class only stores a reference to it. Your items are static instanced, so you have a few, and the tiles are sharing them... so the name is shared by all the tiles, is the sam …
Blau's user avatar
  • 3,386
2 votes

How to deal with corner collisions in 2D?

You need SAT Collision Detection Basically you need to look for the minimum displacement vector that substracted to one of the objects let them to no intersect. In your image the minimum displaceme …
Blau's user avatar
  • 3,386