xna-4.0

Working with multiple screens in XNA 4.0

ⅰ亾dé卋堺 提交于 2019-12-25 15:54:26
问题 I'm struggling to find info how to detect available screens in a XNA 4.0. What I'm trying to do is to get a list of available "screens", select one and start my XNA app as full screen on that screen. Specifically I wan't to open the XNA window in Full Screen mode on a Full HD TV connected via HDMI cable. Thanks, Stefan 回答1: This article explains how to get XNA working on multiple monitors. 来源: https://stackoverflow.com/questions/5301020/working-with-multiple-screens-in-xna-4-0

How to measure sound frequency using c# or XNA? [closed]

烂漫一生 提交于 2019-12-25 08:34:03
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . How to measure sound frequency using c# or XNA?? Have any library do it? I want to record sound and identify the frequency of this sound. 回答1: What do you mean by the frequency? Most sounds, such as voice, music etc. consist of an entire spectrum of frequencies. So what you are

Xml file not found in xap

☆樱花仙子☆ 提交于 2019-12-25 06:13:15
问题 I added a folder to my project and I added an xml file to the folder. Set Build Action of file as Resource . Now try to load the file using line given below XDocument xDoc = XDocument.Load("Xml/MyXML.xml"); The project compiles successfully but while running I get the below exception: Cannot find file 'WORDXML.xml' in the application xap package. Also, i checked the created XAP and not find anything related to folder. Could anybody help me out where I am missing 回答1: You need to set the build

Error with Windows Phone Emulator

好久不见. 提交于 2019-12-25 05:18:47
问题 I am trying to get my windows phone development up and running again. I am having serious issues with the emulator where it looks like this http://imgur.com/qM4uj Here is my info. Running windows 8 on a computer with quad core proc and good video card. Any ideas? Thanks! 回答1: This page might help: http://social.msdn.microsoft.com/Forums/en-US/wptools/thread/5b659eea-9a4f-45ce-8418-b9097d586197/ Emulator Video appears corrupted running XNA or Silverlight + XNA game. The emulator images

Toggling between values while producing events on timer

会有一股神秘感。 提交于 2019-12-25 04:13:49
问题 I'm playing with using the Rx in an XNA proof-of-concept, and I've run into a bit of an obstacle composing some queries that I'm hoping you folks can assist me with understanding how some of these operators work. In my POC, I would like the player's score to increment only while there is not an active drag operation occurring. In addition, there is a 'grab gauge' that I would like to deplete whenever there is an ongoing drag, and fill whenever there isn't. Finally, if a drag operation is

Target the XNA framework in ordinary Visual Studio 2012 project

爱⌒轻易说出口 提交于 2019-12-24 03:38:16
问题 I have a C# XNA host project, with an F# client project that will contain all my functionality. It won't build because the F# project has references to mscorlib.dll and System.dll that the XNA project doesn't agree with (the actual error -- well, its really a warning that in my opinion should be an error -- is at the bottom of the post). How can I tell the F# project to target the actual XNA platform (specifically for the Xbox 360)? C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft

Optimal way to set pixel data?

喜夏-厌秋 提交于 2019-12-24 01:47:23
问题 I'm working on a "falling sand" style of game. I've tried many ways of drawing the sand to the screen, however, each way seems to produce some problem in one form or another. List of things I've worked through: Drawing each pixel individually, one at a time from a pixel sized texture. Problem: Slowed down after about 100,000 pixels were changing per update. Drawing each pixel to one big texture2d, drawing the texture2d, then clearing the data. Problems: using texture.SetPixel() is very slow,

How do I create a multidimensional array of objects in c#

徘徊边缘 提交于 2019-12-23 15:57:25
问题 I am trying to make a script that dynamically generates world chunks by making a height map then filling out the terrain blocks from there. My problem is creating a 2 dimensional array of objects. public class Chunk { public Block[,] blocks; Generate(){ //code that makes a height map as a 2 dimensional array as hightmap[x,y]=z //convert heightmap to blocks for (int hmX = 0; hmX < size; hmX++) { for (int hmY = 0; hmY < size; hmY++) { blocks[hmX, hmY] = new Block(hmX, hmY, heightmap.Heights[hmX

Sorting meshes in XNA

蓝咒 提交于 2019-12-23 15:33:57
问题 I have problem with trees in XNA. When I have tree, I need to use alpha blending to make non-leaf parts transparent, but some parts of model are not correctly displayed and thus alpha blending fails. I want to know if there is possibility to read mesh position to sort them or is there any other way to have transparent non-leaf parts. Sorting in model probably won't work because I want to look at this tree from all angles. 回答1: Alpha blending in a 3D environment can be a tricky issue. Shawn

MessageBox & Dialogs on XNA (C#)

若如初见. 提交于 2019-12-23 04:57:26
问题 I'm having the following code as part of my XNA game: private void gameOver() { if (!m_IsGameOver) { string message = String.Format("GAME OVER!!!{0}Your score is: {1}", Environment.NewLine, GameScore); if (MessageBox.Show(message, "GameOver", MessageBoxButtons.OK) == DialogResult.OK) { this.Exit(); } m_IsGameOver = true; } } private void gameWon() { string message = String.Format("You Won!!!{0}Your score is: {1}", Environment.NewLine, GameScore); if (MessageBox.Show(message, "You Won!",