Extensions (rotate, scale, alpha, fade..)

BlitzPlus Forums/BlitzPlus Programming/Extensions (rotate, scale, alpha, fade..)

goodeep(Posted 2003) [#1]
as a former DIV user, i'm amazingly satisfied by blitz2d which i purchased: i'm already hacking and having a lot of fun.

BUT i really lack some functions which DIV handled in an elegant and simple way:
fade in/out -->absent
alpha --> absent. it'd easily solve the fade problem. it could be great to have the possibility of setting "ImageAlpha handle,percent%" where 100% is acompletely rendered image and 0% is a completely transparent image
scale --> heck, the in-built command is SLOW hence impossible to be used on the fly, but pre-calculate all the sprites is really memory wasting
rotate --> see above.
z-order --> it would eventually help a lot to be able to set the "z" value for an image the way you set its x y values..

well, i've heard of a qlib library which i wasn't able to find (nor on blitzcoder nor on bugface's webpage). i've tried the extended bb library, it's great, but it doesn't handle alpha the way i would, plus i don't like the idea of using BBcommands (drawimageBB, lineBB, loadimagBB) in my whole code to be able to use ONE "rotate" effect on the 45th row!!

can anyone help me in any way? are there functions or a compact libraris or.. dunno!! mainly i'd love to see that qlib library.

comments and help greatly appriciated. tia

see ya, folks!


jhocking(Posted 2003) [#2]
That extended bb library is the best thing I know of for the effects you ask for. I wrote a fade in/out effect (based on someone else's code, but optimized and better looking) and put it in the Code Archives.


cyberseth(Posted 2003) [#3]
fade --> See the "Gamma" commands
alpha --> Use accelerated 3D over 2D using sprites. There should be stuff in the code archives about it.
scale/rotate --> as above.
z-order --> The order that you draw images is the order that they are painted one on top of the other. To change the z-order just draw one image before another. The best method for this is using types, if you've used them yet. The Insert command places one type before another so you can move them around as your z-order requires.

For an excellent tutorial about z-ordering from Krylar: http://www.blitzcoder.com/cgi-bin/articles/show_article.pl?f=gamekrylar11222000.html


goodeep(Posted 2003) [#4]
of course i just got blitz2d ¬_¬'


cyberseth(Posted 2003) [#5]
Use turtle's extended Blitz library that jhocking mentioned:

http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=turtle177605192003023744&comments=no

Uh you'll need a version of Blitz2D that supports the CallDLL command. I don't know what version you've got but if it's a "free" or early demo then it may not have CallDLL. You'd have to end up either purchasing Blitz2D, or better yet purchase Blitz3D/BlitzPlus. Either way you won't be disappointed!! :D