xna

Kinect SDK corrupt memory error

霸气de小男生 提交于 2019-12-29 07:53:16
问题 I have made a program in XNA using Kinect SDK. The program is running perfectly fine in my pc, and many of other PC's, but in one system when I open this program it gives me the following error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. The program stops and it gives me the error message in spritebatch.End() . I am unable to understand why its giving me this error message. The system I am using has 4GB Ram, and the system which is

C# Scripting language

梦想的初衷 提交于 2019-12-28 11:55:31
问题 This is a somewhat odd question. I want to provide a scripting language for modding games that I build for XNA. If I was deplying these games for the PC then I would just be able to use C# files, compiled at runtime (Using reflection.emit) as scripts and that would be fine - a nice simple way to mod the game. However, the .net compact framework (which is what the xbox provides) does not support reflection.emit, so how can I write a scripting language taking this into account? Are there any

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

XNA Puzzle Game how to mouse click [closed]

雨燕双飞 提交于 2019-12-25 08:28:54
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I've been searching everywhere and I dont know what to do to make the cursor able to click on a tile and delete it so other tiles above it can fall down. For that matter, anybody know how to load random tiles on

Looping sound in SoundEffect class Windows Phone 8

百般思念 提交于 2019-12-25 08:17:13
问题 I am developing a game, and need to add background music for that. I tried Microsoft.Xna.Framework.Audio namespace's SoundEffect class. Initially I used SoundEffectInstance Sound = SoundEffect.FromStream(Application.GetResourceStream(new Uri("Assets/background.wav", UriKind.Relative)).Stream).CreateInstance(); Sound.IsLooped = true; Sound.Play(); And it was not working. Then I tried SoundEffect sound; StreamResourceInfo info = Application.GetResourceStream( new Uri("Assets/background.wav",

Get an array of each pixels color from Texture2D XNA?

大城市里の小女人 提交于 2019-12-25 06:26:54
问题 I have a image that contains a layout for a level, and I want to load the level in the game by reading each pixels color from the image, and drawing the corresponding block. I am using this code: public void readLevel(string path, GraphicsDevice graphics) { //GET AN ARRAY OF COLORS Texture2D level = Content.Load<Texture2D>(path); Color[] colors = new Color[level.Width * level.Height]; level.GetData(colors); //READ EACH PIXEL AND DRAW LEVEL Vector3 brickRGB = new Vector3(128, 128, 128); int

Issue with progress bar shader in XNA

怎甘沉沦 提交于 2019-12-25 05:52:11
问题 I'm create a simple shader for drawing progress bar in XNA. Idea is simple: there are two textures and value and if X texture coord less then value use pixel from foreground texture, else use background texture. /* Variables */ texture BackgroundTexture; sampler2D BackgroundSampler = sampler_state { Texture = (BackgroundTexture); MagFilter = Point; MinFilter = Point; AddressU = Clamp; AddressV = Clamp; }; texture ForegroundTexture; sampler2D ForegroundSampler = sampler_state { Texture =

Touch gestures in WinRT (using monogame)

谁都会走 提交于 2019-12-25 05:34:17
问题 I currently have the following code: internal void HandleTouch() { TouchPanel.EnabledGestures = GestureType.DragComplete | GestureType.FreeDrag; while (TouchPanel.IsGestureAvailable) { GestureSample gesture = TouchPanel.ReadGesture(); if (gesture.GestureType == GestureType.DragComplete) { MyAction(gesture.Delta.X, gesture.Delta.Y); } else if (gesture.GestureType == GestureType.FreeDrag) { OtherAction(); } } } The problem that I have is that the Delta is always 0. I read somewhere that

XNA game studio LoadContent

江枫思渺然 提交于 2019-12-25 05:33:23
问题 I found a code to load multiple objects in XNA game stuido but can't call load contect method, what do I need to do? Do I need to call it another class besides Game1 or calling in game1 is just fine? public override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); //Dictionary<string, Model> models = new Dictionary<string, Model>; mymodel = Content.Load<Model>("Models\\tableBasse2"); aspectRatio = graphics

How to set GraphicsDevice.GraphicsProfile

风格不统一 提交于 2019-12-25 05:28:52
问题 In a classic XNA application this value is set through the application properties. By default this value is set to HiDef , at least on the machine I am currently using. But it has to be set to Reach to run. My problem is that I did not find any way to effectively change this value using monogame. The property window is obviously not the same as with XNA and I did not find any config values. Changing the value in the code, in the Game constructor or the LoadContent method does not solve my