exalpha(3alleg4)
β¨ exalpha β¨
okay bestie, welcome to exalpha, straight out of the Allegro manual (that's the Allegro game programming library, section 3, page exalpha, in case you were wondering which manual we're living in today π).
πΈ NAME πΈ
exalpha β creating and using 32 bit RGBA sprites π
from the Allegro game programming library. yes babe, alpha channels, we're doing translucency today, no cap.
π SYNOPSIS π
#include <allegro.h>
Example exalpha
like that's it, that's the whole vibe. one include, one example. iconic.
π¦ DESCRIPTION π¦
okay so here's the tea, bestie π. This program is a whole demo of how to use the 32 bit RGBA translucency functions to store an alpha channel right alongside a bitmap graphic. like, the alpha channel is part of the bitmap now, they're a package deal, they're endgame π.
Two images get loaded from disk:
- one is used for the background
- the other is used as a sprite
and then β this is the part where she really ate β the example generates an alpha channel for the sprite image, composing that 32 bit RGBA bitmap during runtime, and draws it right at the position of the mouse cursor. so the sprite literally follows your mouse around like a little bestie π«Ά. cursor-following sprite behaviour? we love to see it.
π SEE ALSO π
the whole friend group, go say hi:
BITMAP(3alleg4)END_OF_MAIN(3alleg4)SCREEN_H(3alleg4)SCREEN_W(3alleg4)allegro_error(3alleg4)allegro_init(3alleg4)allegro_message(3alleg4)blit(3alleg4)clear_keybuf(3alleg4)create_bitmap(3alleg4)destroy_bitmap(3alleg4)draw_trans_sprite(3alleg4)drawing_mode(3alleg4)font(3alleg4)getb(3alleg4)getg(3alleg4)getpixel(3alleg4)getr(3alleg4)install_keyboard(3alleg4)install_mouse(3alleg4)install_timer(3alleg4)keypressed(3alleg4)load_bitmap(3alleg4)makecol(3alleg4)mouse_x(3alleg4)mouse_y(3alleg4)putpixel(3alleg4)rectfill(3alleg4)replace_filename(3alleg4)screen(3alleg4)set_alpha_blender(3alleg4)set_color_conversion(3alleg4)set_color_depth(3alleg4)set_gfx_mode(3alleg4)set_multiply_blender(3alleg4)set_write_alpha_blender(3alleg4)solid_mode(3alleg4)stretch_blit(3alleg4)textprintf_ex(3alleg4)
and that's the whole page, babe π tysm for reading, mwah. this was Allegro, version 4.4.3, and the page itself is exalpha(3alleg4), dated with the Allegro release. go forth and composite your RGBA sprites, you absolute main character πβ¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms