xna4.0

Formatting Text in C# with XNA

Hello, I'm currently trying to make a TextBox for my GUI with XNA, and I was wondering how could I find tagged text in a string. For instanceI have this kind of text: Hey there, I was <r>going to</r> the <b>Mall</b> today! So the <r> tag would represent red text and the <b> tag would represent blue text. And I want to know exactly whe...

Need help loading XML data into XNA 4.0 project

I'd like to do this the right way if possible. I have XML data as follows: <?xml version="1.0" encoding="utf-8"?> <XnaContent> <Asset Type="PG2.Dictionary"> <Letters TotalInstances="460100"> <Letter Count="34481">&#97;</Letter> ... <Letter Count="1361">&#122;</Lette...

Problems with some textures in XNA

Hi I have made a model using Sketchup, and have tested rendering it using Blender and it looks great. However loading it in XNA has two problems. 1. One of the textures becomes see-thru not entierly transparent but items below on the inside of the model is visible (this is not the case in blender). 2. I have a rounded part on the model...

XNA Texture2D Dispose() + ObjectDisposedException

Hi, I am very new to XNA framework. I am writing a sample application in XNA for windows phone 7. presently I am facing a problem. In the sample, i am loading a Texture2D and dispose it in the next line and assign it to null. Again I load the same image to the same member variable. But in the draw I get ObjectDisposedException. If ...

Difficulty of a side-scrolling game in C#

I was just wondering, if I began learning C#, how long it would take until I would be able to make a game utilizing the XNA Game Studio (4.0) and framework to make an XBOX 360 Live Arcade side-scrolling game. Realistically, I have other priorities too, so I'm just trying to feel out if the "project" is feasible. Obviously, if I wanted ...

How do I load a texture in XNA at runtime?

I'm working on an application that uses the XNA framework to do it's 3D rendering. I now want to load a texture from file. I've found two methods so far: Texture2D.FromStream(GraphicsDevice, Stream) The problem with this approach is that it only loads gif, png and jpg and I also need support for tga images. Create a ContentManager obje...

Xml.Linq - diffrences between XNA 4.0 (windows emulator), .NET 3.5 (Application)

I have created application for testing Linq queries (time) which I using in game project. And now, one query take 1.2s on Windows Application, but when I'm trying to use that same query on windows game (XNA 4.0) it is really, really, really slow and i don't know why. I cannot use SQLite database ( windows game is only for testing purpo...

Drag/Swipe to scroll the screen

What would be the best way to have a vertical scrolling screen? My game will consume two screens high, the user should be able to move between the two screens by a simple drag or swipe action. The background is not tiled and sprites will be placed on it. What would be the best way to go about such screen management? ...

Xna 4.0 3D Vertex example

Hello, 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 ...

Good example of XNA 4.0 to save game data?

I am trying to work my way through the XNA MSDN documentation on saving and reading game data, and I am not having much luck. In essence I have a manager class which keeps track multiple instance of of base classes. I want to be able to save the state of the entire list of objects that the manager is keeping track of then then load the...

Windows Phone 7 target display resolution - recommendations?

The official WP7 emulator uses 800x480 resolution. The only info I can find on planned WP7 phones (eg Samsung Cetus i917) share the same resolution. While I realise the appeal of writing resolution-independant programs, I'd really rather focus on pushing a known set of hardware to the max than sacrificing features and efficiency for one-...

XNA - Signing in with Local Profile

I am trying to learn XNA (4.0) multiplayer networking for the PC only environment. For development, I read that using local profiles (with SystemLink) for PC-only environment does not require me to worry about Xbox Live Licenses. Using Guide.ShowSignIn (1,false); causes the Xbox Live sign-in to come up. But I am stuck here. The sign-...

XNA 4.0 runs at 50 instead of 60 fps.

I'm experimenting a bit with XNA 4.0, following tutorials and creating very basic stuff (like a triangle and some lines ;-)). While doing this, I noticed that all my applications never run at more than 50-51 fps (with Fraps). It's not that I'm running heavy programs on a slow computer or graphics card (Ati HD4870), it must have something...

Making parts of Texture2D transparent in XNA

I'm just starting game development and I thought a game like Tank wars or Worms would be nice. The hardest part I can think of so far is making the terrain destructible and I want to know how it's done before doing the easy parts. I thought that explosion could have a mask texture which could be scaled for different weapons. Then using...

Very simple menu in XNA

Hi guys, Me and some other guys are creating a game, and i would like to add a very simple menu with only Start and Exit Game. Now I already downloaded the Game state management sample, but thats a very long and complicated code. My question: someone knows a site or something where i can make such a simple menu or someone created such a...

powerup in race game

Hi all, I've got a problem: i need to add a powerup to a racegame, using collision detection. so i drawed the powerup, but the problem is: It has to be drawn after every 5 rounds and it needs to be placed ramdomly on the track. Someone with any good advice? Thanks. ...

C# 2010 compile XNA class at runtime

I'm wondering how to compile and run a XNA class from an interaction on a C# Window Form. For example, when I click button "Play" from a C# Window Form, the game which is built in XNA classes will be compiled and run. Hope my question is clear enough. Any helps are appreciated :) Thanks in advance ...

"Press Enter to start the game" XNA INTRO SCREEN

Hi, I created an introscreen with "Press Enter to start the game",(and exit) ofcourse exit is no problem but to let the game start its a bit harder. Any advice? ...

How to debug Xna 4.0 games on PC

I am very new to Xna 4.0 game development on Windows and finding it hard to debug in VS 2010. I really want to see my variable values while I am running the game. Is there any way you can debug? I see this as a debugging add-in. However, I am not sure If that would work with VS 2010. Is there any other add-in or any workaround? I am work...

Problem with different version of pixelshader and vertexshader for spritebatch

I have tried to compile some pixel shader examples. But all of them give the same error message. "Cannot mix shader model 3.0 with earlier shader models. If either the vertex shader or pixel shader is compiled as 3.0, they must both be." The problem seems to be that the pixel shader uses ps_3_0 and sprite batch has earlier version. te...