i heard its using layer but still cant figure it out.
so i just want to see my charater sprite with the background in the background.
help me please
I am tasked with writing an application to output high definition 2D graphics to a television. I don...
By zachnelson
Hi, i read a paper from nvidia about shadowmaps( http://developer.nvidia.com/attach/6769 ) and it te...
By key_46
I am trying to find out how many bytes in total have been allocated for D3D resources in our program...
By su_zeelot
HiI have a usercontrol that draws an image from a file. The image in the form is also able to be dra...
By denham
HiI'm currently wrestling with the coordinate system. I have three 3d objects (.3ds) that I want to ...
By slayerizer
Over at http://XBOX360Homebrew a competition has been running during the beta, for those who haven't...
By darkside
If I have a bunch of 3d pixels, lets say in this format (I could maybe chage it if required):R, G, B...
By neederofvbhelp
Hi!I'm currently using 3D Studio Max to create scenes, then export them into .x file format and then...
By pawelj, 8 Comments
I am putting this up hopeing it will be a community driven FAQ. If you see something asked often pos...
By percent20, 1 Comments
Hi,I am new to XNA and C# as well. I am using the code from here (http://andyq.no-ip.com/blog/?p=16)...
By pic, 4 Comments
I managed to have an MDI child form which uses directX, it's somehow convoluted, but it works, the p...
By onishiro, 4 Comments
Hi, I find that XNA is a very interresting tools, powerful and offering a lot of possibilities for t...
By christophedesplanches, 1 Comments
Greetings!I have a development team working on an Xbox Live Arcade title for the Xbox 360 using XNA ...
By madmojo1, 9 Comments
Hi All,I has c# + directX 9c 3D games develop experience. I want to try start develop xna 3D games. ...
By brian_tsim, 2 Comments
I was simply wondering if I could use the beta to build a game to be released in the beta timeframe?...
By amadrias, 2 Comments
Code, please.
jimperry | Fri, 07 Sep 2007 17:03:00 GMT |
today i attended to microsoft techdays academic track in lisbon, portugal.
rob miles brilliantly introduced us to xna and in one of his code samples he shown how to create a background
you can find the code samples in his website, here
04 CheeseBreakout - Backdrop.zip > BackDrop.cs
public override void Initialize()
{
Game1 parent = this.Game as Game1;
content = parent.content;
this.DrawOrder = 0;
base.Initialize();
}
DrawOrder = 0; tells that texture should be placed in the background
just trying to help, hope it does
hda | Fri, 07 Sep 2007 17:04:00 GMT |
If you are drawing both items in a single SpriteBatch, make sure the background is drawn first.
MySpriteBatch.Begin();
MySpriteBatch.Draw(Background... etc...);
MySpriteBatch.Draw(Player... etc...);
MySpriteBatch.End();
If you are drawing them in 2 separate SpriteBatches, make sure the background SpriteBatch is drawn first
BackgroundBatch.Begin();
BackgroundBatch.Draw(Background... etc...);
BackgroundBatch.End();
PlayerBatch.Begin();
PlayerBatch.Draw(Player... etc...);
PlayerBatch.End();
leec22 | Fri, 07 Sep 2007 17:05:00 GMT |
thanks. its working grand now. im not to familar with xna or game programming so this is all new to me.
my
next problem is that although i can now see my character, i can see him
inside a box. how can i make the box part blend in with the bcakround
so that i can only see my character.
does that make sense. im looking into it myself but would appriciate any help.
carroll_iain | Fri, 07 Sep 2007 17:06:00 GMT |
You need to make sure that the area around the character is actually transparent in the image. For this, you have to make sure you are saving the image in a format that supports transparency. PNG is favourite and is the format I would recommend. Depending on the paint package you are using, it could be done in different ways but basically it should be just a case of telling the package which colour you want as transparent.
leec22 | Fri, 07 Sep 2007 17:07:00 GMT |
ok. so do i do that in the paint program im using or is it a property i set in the xna studio.
carroll_iain | Fri, 07 Sep 2007 17:08:00 GMT |
If you make the box around the sprite magenta and call the SpriteBatch's Begin with the SpriteBlendMode.AlphaBlend paramter, you should be good.
jimperry | Fri, 07 Sep 2007 17:09:00 GMT |
sorry but that didnt work. i did what u said with the magenta but i can just see that now instead of the previous color. i set the SpriteBatch Begin with the parameter u said as well but no luck.
thanks anyway.
any other ideas
carroll_iain | Fri, 07 Sep 2007 17:10:00 GMT |
You still haven't shown us your code so it's hard to off advice.
jimperry | Fri, 07 Sep 2007 17:11:00 GMT |
it ok i got it working. i just used the Direct X SDK texture tool. and i didnt have to alter any code. i found the help on xna tutorials web site.
carroll_iain | Fri, 07 Sep 2007 17:12:00 GMT |
If you find out what the problem was, you can avoid using that tool. I found it a pain to keep using that. What paint software are you using?
If you can tell me this, I can tell you the steps you need to go through to get the PNG with a transparent background, which will make life much easier.
leec22 | Fri, 07 Sep 2007 17:13:00 GMT |