Skip to main content
gamedev.net
🔒 Locked

DXCreateSprite

Started by CaptCanada 1 reply 350+ views
Original Post
CaptCanada
CaptCanada
Hi all I am making a simple arcade game with a static bmp for the background. I have my program loading the background and displaying it. I have a sprite I want to load and would like to know if I have to use the DX8CreateSprite method to load the sprite? I am sorry if I have refered to the method with the wrong name. Right now, I have been trying to use just one backbuffer surface to load the background image and then to load in the sprite into the same buffer and display it. So, I guess I am asking what the preferred? method is to load a background image and then to load and display a sprite image over it, with transparency of course. Thanks for you help in this matter and with the other posts I have made in the past.
Better to try and fail than to fail by not trying.
Sir Valeq
Sir Valeq
D3DXSprite is only an interface for drawing sprites. You must only call D3DXCreateSprite() once in your app and have only one instance od ID3DXSprite.
Your sprites (the drawn ones) will be just textures and corresponding data (position, rotation, clip rectangle). You will load new sprites by loading new textures with D3DXCreateTextureFromFile*().
Go get yourself a tutorial about D3DXSPRITE - it''ll be the best option for now.

--------------
"We cannot all be masters." - William Shakespeare
--------------"We cannot all be masters." - William Shakespeare
CaptCanada
CaptCanada
Thanks for the info.

The reason I ask is because some of my older DX books used a seperate surface to load in a .bmp that would be used as the sprite. My newest book, Teach Yourself Game Programming With DirectX In 21 Days, does, of course, teach you how to create surfaces and load images to them, but the book is teaching me how to program an rpg.

I ask about D3DXSprite because of the great tutorial on it on the nexe.gamedev.net site, it looked like this was the way to load sprites for games.

Thanks again for the help, and more importantly, the patience for such a longwinded and I am sure, circular, post!

Better to try and fail than to fail by not trying.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.