Skip to main content
GameDev.net gamedev.net
🔒 Locked

2D Sprite effects

Started by Bernard Oct 8, 2001 at 9:57 AM 13 replies 2k views
Original Post
Bernard
Bernard
Hi. Now some people may think this is a strange question, but I''m going to ask anyway... Can anyone point me in the direction of some nice tutorials/examples of 2D sprite effects. By this I mean - coloured sprites, transparent etc... Now I know this can be achieved using Direct3D, but I''d like to do it in Directdraw for my 2D game. Direct3D is such a pain to set up, and I really don''t need any of the other features. Can anyone assist?
------------------------------In the heights, all paths are paved with daggers.
CrazedGenius
CrazedGenius
Well, if you need transparency and other "effects", then Direct3D would be very worthwhile. If you''re learning something anew, don''t spend time learning a dead api!

There are articles here and elsewhere. Setting up the basics to get started should take only a couple hours.
granat
granat
Microsoft keep changing their API''s so just learn what you need right now.
-------------Ban KalvinB !
rk
rk
I don''t totally get what you mean by "2d sprite effects", but here are some links that might be useful.

Here''s a good series of tutorials which has much information about 2d effects:

http://www.flipcode.com/demomaking/

Here are also some but I didn''t find them as useful as the ones at flipcode:

http://www.gamedev.net/reference/list.asp?categoryid=72

These tuts are not about DirectDraw but they should give you the basic idea.

Here''s a link that has many tuts on DirectDraw:

http://www.gamedev.net/reference/list.asp?categoryid=24#51


rk

May God bestow serenity upon me to accept what I can not change, courage to change what I can, and wisdom to distinguish those two from each other.
CrazedGenius
CrazedGenius
true, the DX api is constantly changing, but...

1. the "3D way" isn''t going away any time soon, and it has always been the way to do good 2D in OpenGL.

2. Even if DX changes radically again, they are not going to reinstate DX7. Automobile technology changes, but I still wouldn''t recommend learning how to drive horse drawn carriages.
appar1tion
appar1tion
Try the D3DX wrapper functions that come with DX7 and 8. They are easy to set up, and will give you a very easy way of doing rotation, alpha blending and scaling.
Bernard
Bernard
Thanks for the replys guys... I appreciate the concerns with the "dead api" thing, but it''s not something I haven''t considered. I will check out the links!
------------------------------In the heights, all paths are paved with daggers.
granat
granat
quote:
Original post by CrazedGenius
2. Even if DX changes radically again, they are not going to reinstate DX7. Automobile technology changes, but I still wouldn''t recommend learning how to drive horse drawn carriages.


Gee, good analogy *end sarcasm* !!

-------------Ban KalvinB !
grasshopa55
grasshopa55
2D will never go away, so calling DX7 a "dead" api is a bit over dramatic. There is still a need for 2D games. Look at the portable market. Systems like Game Boy Advance and the budding PocketPC market. Learning how to use DirectDraw before jumping into Direct3D is a huge help. By understanding the basic concepts of 2D animation, moving to 3D is much easier.

In regards to Bernard''s original question, it is much easier to do many effects using 3D hardware then going the software route. Much of the D3DXSprite, provided my Microsoft, allows for all sorts of effects like alpha blending ( color shifting/fading ), scaling ( growing/shrinking ), and rotation. Some of these effects can be achieved in 2D, but require more knowledge about the hardware it is going to be run on.

-----------------------------
kevin@mayday-anime.com
http://games.mayday-anime.com
-----------------------------kevin@mayday-anime.comhttp://www.mayday-anime.com
CrazedGenius
CrazedGenius
Hmmm... With DX8 out and DX9 around the corner, isn't DX7 "dead" by definition? Of course you can still use it, but the API has changed pretty dramatically between 7 and 8.

The "learning DirectDraw" and "2D gaming" arguments are separate. My concern is that any time spent figuring out the difference between Blt and BltFast is completely wasted moving forward. I wasn't pushing for 3D games, just 2D in the Direct3D context.

About horse drawn carriages... DirectDraw was made to suit 2D cards with a heavy emphasis on fast blitting and nothing else. Current technology doesn't adhere to that model. In fact, I've worked with 2D medical imaging cards that are now much slower than the GF3 for 2D image processing operations. But, the GF3 using a much different model for 2D image processing, so if you wanted to use the GF3 power, it would not be worthwhile to learn the blit API of the medical card. The point is that the current technology is very different from the old technology and you are better off learning an API that will be compatible going forward. I think it's a pretty good analogy in terms of a technological discontinuity.

Edited by - CrazedGenius on October 9, 2001 12:03:07 PM
Lotan
Lotan
By the definition of COM, you can still use Direct Draw 7 even with DirectX 8, 9 or whatever. If you''ve decided you want to use 2d, then more power to you.

Jesse
grasshopa55
grasshopa55
What it all comes down to is what are you trying to do. If you are looking to build a game for GBA or PocketPC or some low end PC, the you may want to stick to DirectDraw. If you are just looking to learn something new, and plan on building from that knowledge, then going the 2D in 3D route will benefit you more. As does every debate in programming, it depends on the programmer and their preference. Bernard, go with whatever you like, that''s the beauty of programming. You are free to do and create whatever you like. And most of all have fun, that''s what it is all about.

-----------------------------
kevin@mayday-anime.com
http://games.mayday-anime.com
-----------------------------kevin@mayday-anime.comhttp://www.mayday-anime.com
SikCiv
SikCiv
I recommend using Direct3D for blitting in 2D, the 3D initialization can be tricky but once u get it all up and running its quite easy to use and understand, and at the same time you''ll know a bit about 3D coding

To get u started download the D3DXSprite wrapper from my site, its designed to be easy to use and efficient:

  Downloads:  ZeroOne Realm

  Downloads:  ZeroOne Realm
Bernard
Bernard
Thanks again for all the replys! I was just curious!!! I'm writing a 2D game at the minute, just to get something finished under my belt for demoing. After this I will probably start a nice 3D engine. I already tried some 3D a while ago, and I just didn't have the time to devote to the design required for a well-written engine (and there's no point writing a half-arsed one in my opinion)

I agree, 2D is not dead! Long live 2D!!! This is part of the reason I'm writing a 2D platform game at the minute anyway... 'cos I like 'em.

SikCiv, I've already looked over your sprite wrapper thingy, and it's not bad at all. I'll probably write something similar myself soon. No offence or anything, I just like to use my own code s'all. I downloaded your game too, not bad! When my game is a bit more developed, I'll put up a web page and you can have a look (if you want to that is)

Actually, here's a little piccy of my game so far....




Edited by - Bernard on October 10, 2001 6:10:01 AM

Edited by - Bernard on October 10, 2001 6:10:47 AM
------------------------------In the heights, all paths are paved with daggers.

Topic Locked

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

Sign in to reply to this topic.