Hello, I know allegro 4.4 is outdated but we have to use it for a school project.
I can't figure out how to use the fade_in and fade_out functions. In this code : https://gist.github.com/walidjabari/c2c58f27ecb826e83c6eba7ab5e1f79b
I'm trying to make use of the fade_out(int speed) function in order to fade out from a green to a black screen, but it doesn't seem to be working properly.
Thank you for your help !
]]>You can't, since you are probably not using 8 bit colour for your desktop colour depth.
This is an old "palette" effect which doesn't translate to non-palettized modes (e.g. 32 bit / 24 bit colour, even 15/6 bits) which are common today.
Okay, thank's for the reply.
What would be best way to fade in/fade out a bitmap in allegro 4.4 ?
]]>Allegro 4 can use 16/32-bit color.
Do you explicitly NEED 8-bit color?
]]>I am just trying to fade in/fade out bitmaps to the screen.
The only constraint I have is to use allegro 4.4.2 instead of the more recent one.
I can't figure out how to make proper usage of the functions fade_in(const PALETTE p, int speed) and fade_out(int speed)
I just commented my code to allow a better understanding of what I'm trying to do
https://gist.github.com/walidjabari/c2c58f27ecb826e83c6eba7ab5e1f79b
Thanks for the help
]]>You're not using 8-bit color, so there's no PALETTE.
You'll need to interpolate between the two colors yourself, and perform a manual fade.
EDIT
Minor code update.
Also, if you can use Allegro 5, use that instead. It's pretty much better for everything except super-retro games that run in DOS.
]]>Thank you, I understand now.
Is it possible to apply the same thing with BITMAPS?
]]>I believe you can achieve transparent blending in Allegro 4 using set_trans_blender and draw_trans_sprite.
]]>Yes!! it worked.
Thank you very much for your help