Hello to everybody!

The last project I'm working on is a sort of city traffic simulator. I'll have a huge map (almost a cartoon) and I'll have to put on it some sprites. I'm rather fluent with Masm but a total newbie about graphics.
After several days (yep, it's true) of googling and reading and digging the results I ended up with some IMGLIB and GFL
stuff. Seems the best I can barely understand. Well, what I need is to know how to put 2D sprites on the Dialog.
I thought either a jpg or gif with a transparent background could do the job. I'd heard about "alpha" but I'm too much
ignorant about it.
Does anyone of you guys give me some light ?


Posted on 2007-08-23 21:50:02 by damarck



Drawing 2D is extremely easy: you simply copy rectangles of data (from array1[][] into screen[][] ).
There are 3 ways to copy a pixel:
1) dest = src;
2) if(src!=MAGENTA)dest=src; <- called "transparent copy". Pixels appear either 100% opaque or 100% transparent
3) blending. Many, many ways to do this, it's become an art of itself. Alpha-transparency, saturating-addition, and ... "shaders". 3D games nowadays boast how good/interesting shaders they have. The most common blending, "alpha-blending" is the function:  dest=(src*alpha + dest*(255-alpha))/255;  (this is done for each of the R,G,B components of the colors)

I suggest using Ilix, rather than sDraw - but look at the docs of both.
Posted on 2007-08-23 22:26:49 by Ultrano
thank you very much indeed for your massive help
Posted on 2007-08-24 04:22:07 by damarck