How to scroll a 2D background
Well, I've been searching the web and I cannot find a single example of someone scrolling a 2D background using Managed DirectXWITHOUTusing the deprecated DirectDraw.
I can already scroll a background using DirectDraw, but I'm trying to be a good boy and stop using the deprecated code. I've been struggling to figure this out for myself, but I'm just not understanding what techniques and objects I would use to scroll a 2D background.
If someone could give me some example code of how to accomplish this with Direct3D or point me in the right direction to a resource that demonstrates the technique to use, that would be great.
So far, everything resource that I have found online that claims they are scrolling a 2D background using managed DirectX are just doing it the deprecated way with DirectDraw.
Any help at all would be appreciated, I want to kick the deprecated code habit, but it's hard with little examples out there for the 2D game developer.
That is EXACTLY what I was looking for. What's funny is I came across your site earlier in my search but I thought you were drawing a black background and then drawing stars as various sprites on top of it.
So I didn't think you were moving a background at all, but instead were just moving the random star sprites you sprinkled across it to simulate a ship moving through space. Man, was I way off. That's what I get for just glancing at the code.
Just to let you know, after looking at your code tonight I was able to get my own 2D side scrolling background to work. Thanks again, you can't imagine what a relief it is to finally understand how to make that work and now actually SEE my background scrolling.
Nice job, I really appreciate you taking the time to help me out. Guess I can finally start kicking that old deprecated DirectDraw code to the curb.
Glad that I could help, But you could also help...
As you are working to use Direct3d instead of Direct Draw, you might be able to help by documenting some of the things that you are working on so that others may also drop DirectDraw. You are more then welcome to publish your work in the forums on Inner Realm.
Mykre
www.ircomm.net
Managed DirectX and Game Programming Resources.
I just wanted to let you know Mykre that I have taken your advice and am trying to document my progress on my little side project in 2D development with Managed DirectX (without using DirectDraw). I am attempting to keep my progress chronicled at
Storyteller Software, but I'll admit it's a little short on code samples right now. I'm hoping to correct that as time goes on (just overcame one of my hurdles of simplifying the time consuming process of making my VB code look good in HTML), but I just wanted to say thanks again for your help in kick starting my project and I hope that I can repay the favor for others that have questions on 2D development with Managed DirectX.
Thanks again and I plan on continuing to use you and your site (as well as these forums) as a great resource for me.
I'll be sure to check it out David, thanks! I remember you saying before that a 2D sample was going to be included, but then I totally forgot to look at it! Thanks for reminding me.