|
Tinting white |
Schyfis
Member #9,752
May 2008
|
In Allegro 4.2, you could use draw_lit_sprite to tint a sprite white. Is there a way to draw a sprite with a white tint in Allegro 5? If so, a sample would be much appreciated! ________________________________________________________________________________________________________ |
Trent Gamblin
Member #261
April 2000
|
It can't be done without a shader (or maybe some weird extensions I don't know about) with OGL/D3D.
|
tobing
Member #5,213
November 2004
|
I'm using al_draw_tinted_bitmap to draw a bitmap lighter than it originally is, with something like al_draw_tinted_bitmap(bmp, al_map_rgba(60,60,255,0), x, y, 0);
but it may be that you also need to set a suitable blender mode, see |
SiegeLord
Member #7,827
October 2006
|
See this thread for the shader and an approximate non-shader blender hack. I have proposed adding a new set of functions to the shader addon that would make these common effects more painless: ALLEGRO_SHADER* al_create_default_shader(); ALLEGRO_SHADER* al_create_light_shader(); //etc or even more simply: ALLEGRO_EFFECT_STATE* al_create_effect_state(); al_use_default_effect(ALLEGRO_EFFECT_STATE* state); al_use_light_effect(ALLEGRO_EFFECT_STATE* state, ALLEGRO_COLOR light); The latter you'd use like this: ALLEGRO_EFFECT_STATE* state = al_create_effect_state(); al_use_light_effect(state, al_map_rgba_f(1, 1, 1, 1)); al_draw_bitmap(bmp, 0, 0, 0); // The bitmap is now pure white
"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|