xna

Can I create games using XNA if I have Visual Studio 2010 installed?

谁都会走 提交于 2019-12-12 11:34:14
问题 Pretty straight forward question. Thank you. 回答1: To be a pedant, yes you can: just not inside of VS 2010. You can install a 2008 Express version side-by-side and use that, until they update XNA for 2010. 回答2: Basically: XNA Game Studios 3.0 and 3.1 go with Visual Studio 2008. (Note: anywhere I say "Visual Studio" it also applies to Visual C# Express.) XNA Game Studio 4.0 (currently in beta) goes with Visual Studio 2010. (Note: XNA GS 4.0 is part of Windows Phone Developer Tools). Both Visual

Rotating a sprite around its center

。_饼干妹妹 提交于 2019-12-12 11:03:21
问题 I am trying to figure out how to use the origin in Draw method to rotate a sprite around its center. I was hoping somebody could explain the correct usage of origin parameter in Draw method. If I use the following Draw method (without any rotation and origin specified) the the object is drawn at the correct/expected place: spriteBatch.Draw(myTexture, destinationRectangle, null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0); However, if I use the origin and rotation like shown below,

How to calculate SCREEN to WORLD position in 2D game

隐身守侯 提交于 2019-12-12 10:53:27
问题 I have this class, I use it for drawing sprites in my 2D game: using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Audio; namespace Namespace { /// <summary> /// Found this brilliant code at. /// http://adambruenderman.wordpress.com/2011/04/05/create-a-2d-camera-in-xna-gs-4-0/ /// </summary> public class CCamera2d { private const float zoomUpperLimit = 1.3f; private const float zoomLowerLimit = .85f; private float _zoom; private Matrix

How to prevent GraphicsDevice from being disposed when applying new settings?

眉间皱痕 提交于 2019-12-12 10:35:39
问题 My game window has manual resizing allowed, which means it can be resized like any other normal window, by dragging its edges. The game also makes use of a RenderTarget2D rt2d , to which the main Render Target is set in the main Draw method: GraphicsDevice.SetRenderTarget(rt2d) , but it is reset back to null (the default render target) in the end of the main Draw method, which makes it a little bit confusing: is this really the source of the problem, resizing the game window right between the

XNA alternative [duplicate]

落爺英雄遲暮 提交于 2019-12-12 09:45:04
问题 This question already has answers here : Alternative to Microsoft XNA Game Studio? [closed] (2 answers) Closed 6 years ago . I recently switched to VS2012, managed to get XNA4 project working, but then I was wondering if VS2012 no longer supports (so really) and XNA seems to be such abandoned stuff, if there is an alternative to use, that is like: vs2012 compatible, and net4.5, c# not too high level (or well written and optimized) easy to learn after XNA free Priorities are from above. 回答1: I

Game Programming and Event Handlers

丶灬走出姿态 提交于 2019-12-12 09:35:25
问题 I haven't programmed games for about 10 years (My last experience was DJGPP + Allegro), but I thought I'd check out XNA over the weekend to see how it was shaping up. I am fairly impressed, however as I continue to piece together a game engine, I have a (probably) basic question. How much should you rely on C#'s Delegates and Events to drive the game? As an application programmer, I use delegates and events heavily, but I don't know if there is a significant overhead to doing so. In my game

Difference between SoundEffect and SoundEffectInstance classes

大兔子大兔子 提交于 2019-12-12 08:41:24
问题 Like in question, i don't get what is the difference between using those classes. What are advantages and limitations of each class. I read many tutorials, and still can't decide what should i do. To make things more clear, i got AudioModule, AudioEmitterComponent and AudioListenerComponent. (Our game's eninge is based on component. When you create and object which is source of some sounds (monster or sth), i add emitter component.. and i got problems then. I can't figure out how to do it

C#/XNA Giant Memory Leak

两盒软妹~` 提交于 2019-12-12 08:16:21
问题 this is my first post here. I'm making a game in Visual Studio 2010 using XNA, and i've hit a giant memory leak. My game starts out using 17k ram and then after ten minutes it's upto 65k. I ran some memory profilers, and they all say that new instances of the String object are being created, but they aren't live. The amount of live instances of String hasn't changed at all. It's also creating instances of Char[] (which i'd expect from it), Object[], and StringBuilder. My game is pretty new

how can i use content manager in console aplication to load a new Model?

梦想与她 提交于 2019-12-12 06:27:02
问题 how can i use content manager in console application to load a new Model? I want to load mesh data without any display ? 回答1: Check out my answer to this question. It contains code for getting a ContentManager working in a console application. To duplicate it here briefly: You need the ServiceContainer and GraphicsDeviceService classes from the WinForms sample. Then just use this code: Form form = new Form(); // Dummy form for creating a graphics device GraphicsDeviceService gds =

Game page navigation

最后都变了- 提交于 2019-12-12 05:37:26
问题 I am trying to build an simple game using XNA 4.0 on Windows Phone. On my project, I will have 2 page, MenuScreen and GameplayScreen . In Silverlight, I can add new page easily And I can use NavigationService.Navigate("/blablabla.xaml") to move to another page on my project. How can I do that on XNA? There are no page options when I want to add new item. 回答1: Because XNA hasn't the concept of page. If you need to use Silverlight you can easily create a project that use XNA and Silverlight,