Dark Bit Factory & Gravity
PROGRAMMING => Freebasic => Topic started by: Hotshot on January 27, 2007
-
here is.
I saw drawimage ( does it mean it is same as blitzbasic when used bitmap sprites?) as I just wondering as it doesnt show drawimage example in freebasic.
cheers
-
That's a solid fist try Graham :) Nice job, in fact you can have some Karma for that.
As far as image drawing is concerned, there are some functions in the freebasic graphics lib to do that for you.
Alpha etc is very easy to do.
This example was taken from the feeebasic help manual (press F1 in the editor), I've modified it slightly so that you need to press a key to exit..
OPTION explicit
'' set screen mode
SCREEN 15, 32
'' allocate and draw to an image buffer
DIM image_buffer AS ANY PTR
image_buffer = ImageCreate( 64, 64, RGBA( 64, 160, 0, 255 ) )
CIRCLE image_buffer, ( 32, 32 ), 28, RGBA( 255, 0, 0, 128 ),,,,F
'' blit image buffer to screen
PUT( 160, 120 ), image_buffer, PSET
PUT( 180, 140 ), image_buffer, ALPHA
'' free image buffer memory
ImageDestroy( image_buffer )
while inkey$=""
wend
end 0
-
it would be nice if freebasic have drawimage like blitzbasic even thought freebasic does have load of library such as SDL( I dont like it for some reason) and allergo( which is good)
-
Well, the good thing is that there is a library that you feel comfortable with using. If you like Allegro then more power to you. SDL is quite a popular library too. Optimus made a great demo with it called Keftedes.