xna

Locking files when building in Visual Studio 2010

。_饼干妹妹 提交于 2019-12-05 11:08:52
问题 Hello there, Stackoverflow. Recently, when I've been programming in Visual Studio 2010, I've been getting the problem with VS locking the bin/Debug/(ProjectName).exe file when trying to build and gives me the error below after trying to build the project 10 times: Unable to copy file "obj\x86\Debug\TileEngine.exe" to "bin\x86\Debug\TileEngine.exe". The process cannot access the file 'bin\x86\Debug\TileEngine.exe' becuase it is being used by another process. The problem appears when I edit the

XNA Redistributable missing from Publish Prerequisites options

不想你离开。 提交于 2019-12-05 10:38:59
I've gotten XNA running perfectly fine on Visual Studio 2012 and publishing, installing and running the game works fine as well on any computers that already have the XNA Framework Redistributable 4.0 installed but when I attempt to install on a computer that doesn't already have it, the install fails due to it being missing. Furthermore, it isn't even an option in the Prerequisites menu on the program's publish properties. When I open up an older project, the option exists but with a yellow exclamation triangle and I don't believe it is actually being set. Does anyone know how I can add the

Changing RenderTarget Results in Purple Screen?

时光怂恿深爱的人放手 提交于 2019-12-05 08:26:07
I'm attempting to change RenderTargets at runtime, so I can draw some elements at runtime, manipulate them and then finally draw the texture to the screen. Problem is, the screen turns purple if I change the RenderTarget at runtime. Here's the code I've got in Draw: RenderTarget2D tempTarget = new RenderTarget2D(GraphicsDevice, 128, 128, 1, GraphicsDevice.DisplayMode.Format, GraphicsDevice.PresentationParameters.MultiSampleType, GraphicsDevice.PresentationParameters.MultiSampleQuality, RenderTargetUsage.PreserveContents); GraphicsDevice.SetRenderTarget(0, tempTarget); GraphicsDevice.Clear

Ambiguous reference between MonoGame & Microsoft.XNA.Framework namespaces

有些话、适合烂在心里 提交于 2019-12-05 08:17:41
MonoGame (a framework which basically brings XNA to Windows Phone 8) has all it's namespaces prefixed with Microsoft.Xna.Framework I believe to minimise the amount of code changes required when porting your XNA app to MonoGame. My issue is, I wish to access the Microphone class, which, because has not been created in MonoGame yet, I have to utilize it from within in the official Microsoft XNA class, this requires taking out the explicit forced removal of the standard Microsoft.XNA.Framework.dll references within the .csproj that my MonoGame template has setup to avoid conflicts, which works

Detect collision between a moving object and an immobile one

瘦欲@ 提交于 2019-12-05 08:14:42
First of all, my question isn't really specific to C# or XNA, but my code examples will use these. I am currently trying to make a Pong clone and I've run into a problem with collision-detection. Each object basicly has a specific Velocity(which is a Vector2), Position(Vector2, also) and Speed(just a float). On every Update() call of the object, the position is changed this way: Velocity.Normalize(); Position += Velocity * Speed; At first, I only checked if there currently was a collision between two objects with a simple Intersects() call from the rectangles of the objects. I quickly realized

Jint + XNA (C#)

前提是你 提交于 2019-12-05 07:47:41
Is it possible to use jint to manipulate a 3D environment created with XNA (C#), and to add functionality to this environment (again using jint)? As a contributor to Jint, I would recommend you Jint . Jint makes it more simple than what Lua does. Moreover, I don't know if this is possible with Lua, but you can give it .NET objects and play with them in javascript (Jint stands for Javascript INTpreter). You can also secure your application with Permissions Set. Here is the same code provided before with Jint : class Program { static void Main(string[] args) { Program p = new Program(); p.Run();

How can I watch for file changes in a UWP project?

耗尽温柔 提交于 2019-12-05 07:10:22
I am porting my game to UWP from the full desktop .net and one thing I need to work out is how to live load texture, shaders etc... into the UWP version of the game. In the desktop version I use a FileSystemWatcher to do this but FileSystemWatcher doesn't exist in UWP, even on directory's that I have full control over. Is there an equivalent for UWP? What is the best way to implement this with the limited set of API's in UWP? Grace Feng Is there an equivalent for UWP? You can subscribe the ContentChanged event for the queried storage files. For example: List<string> fileTypeFilter = new List

How can I tint a sprite to white in XNA?

泪湿孤枕 提交于 2019-12-05 06:10:57
I don't think this is possible just using the color setting in SpriteBatch, so I'm trying to work out a simple shader that would take every pixel and make it white, while respecting the alpha value of the pixel. The answer Joel Martinez gave looks right, but how do I incorporate that when I draw the sprite with SpriteBatch? I think this is what you're looking for sampler2D baseMap; struct PS_INPUT { float2 Texcoord : TEXCOORD0; }; float4 ps_main( PS_INPUT Input ) : COLOR0 { float4 color = tex2D( baseMap, Input.Texcoord ); return float4(1.0f, 1.0f, 1.0f, color.w); } It's very simple, it just

WPF vs XNA to render thousands of sprites

隐身守侯 提交于 2019-12-05 04:41:39
I need to render thousand of ellipses linked each others with lines. What would be the best way (in terms of performances) to render it inside a WPF application. Is WPF Canvas painting a lot worse than XNA painting ? Actually, the hidden question is : is it possible to do some xna-rendering inside a WPF host ? I saw some examples that used a borderless xna window overlay, but no native soluation... Thanks, Aurélien If done right you can get some pretty high performance in WPF rendering which hast the advantage that you don't have to take the WPF-XNA interop pain. You can render (and animate) a

Xna 4.0 3D Vertex example

感情迁移 提交于 2019-12-05 04:29:13
问题 I'm currently trying to make a simple square by combining two triangles, like in the tutorials by Riemer (Link to tutorial), but since a lot has changed from 3.x to 4.0, I find it difficult. I would also like to know how to texture this "square", so if anyone could help me by giving some example or whatsoever, I would appreciate it :) Thanks! Basic 回答1: Here is an example XNA 4.0 program that draws a simple textured square. It requires the Green-gel-x texture (from wiki-commons - link in code