1. RE: Alpha Blending with EuAllegro

Excellent question I was wondering the same myself.

Steve A.




Lewis Townsend wrote:
> 
> 
> posted by: Lewis Townsend <keroltarr at hotmail.com>
> 
> Ray or anyone with answers,
> 
> My project in Euallegro is comming along fine.
> I am interested in using the draw_trans_sprite routine.
> How do I define the level of transparency I am drawing?
> I want to use different amounts of tranparency for the same image.
> .. at different times. ask for details.
> 
> thanks for any help,
> LewyT

new topic     » topic index » view message » categorize

2. RE: Alpha Blending with EuAllegro

It looks like Ray doesn't check this board very often.
I was afraid I didn't explain myself very well.
Does the draw_trans_sprite routine just use the alpha channel of the image?
The documentation mentions setting up blender functions.
What are they and how do I set them up?

I have a few more problems with EuAllegro:
Using timer routines causes random errors in my programs.
EuAllegro programs always leave an EXW.EXE in my processes (task manager)

Lewy T

new topic     » goto parent     » topic index » view message » categorize

3. RE: Alpha Blending with EuAllegro

>From: Lewis Townsend <guest at RapidEuphoria.com>
>Reply-To: EUforum at topica.com
>To: EUforum at topica.com
>Subject: RE: Alpha Blending with EuAllegro
>Date: Sat, 03 Jul 2004 12:51:54 -0700
>
>posted by: Lewis Townsend <keroltarr at hotmail.com>
>
>It looks like Ray doesn't check this board very often.
>I was afraid I didn't explain myself very well.
>Does the draw_trans_sprite routine just use the alpha channel of the image?
>The documentation mentions setting up blender functions.
>What are they and how do I set them up?
>

     I don't know how up-to-date Ray's work is, but according to this: 
http://www.allegro.cc/manual/view_function.php?_id=1304 it will use the 
global color_map table, or trucolour blender functions. It depends on the 
images you are using You can call set_alpha_blender() to set up truecolour 
blenders. Perhaps if you read that page, you will understand it better than 
I.

>I have a few more problems with EuAllegro:
>Using timer routines causes random errors in my programs.
>EuAllegro programs always leave an EXW.EXE in my processes (task manager)
>

  I don't know about this...

>Lewy T
>

~[ WingZone ]~
http://wingzone.tripod.com/

new topic     » goto parent     » topic index » view message » categorize

4. RE: Alpha Blending with EuAllegro

Lewis Townsend wrote:
> 
> It looks like Ray doesn't check this board very often.
> I was afraid I didn't explain myself very well.
> Does the draw_trans_sprite routine just use the alpha channel of the image?
> The documentation mentions setting up blender functions.
> What are they and how do I set them up?
> 
> I have a few more problems with EuAllegro:
> Using timer routines causes random errors in my programs.
> EuAllegro programs always leave an EXW.EXE in my processes (task manager)
> 
> Lewy T

Even though I promised to keep EuAllegro up-to-date and haven't, I still can't
give you the answer you are looking for.  Like Ray, I've just translated the 
demo programs without actually understanding how the blender functions work.
If I did, I might write a helper routine that would let you express the 
transparency in a percentage or something.  I'll check it out and get back
to you (likely after the holiday).

I lost interest because it didn't seem like many others had much interest
(and I think that's also why Ray lost interest...).

I'll swing my focus back that way and see what I can do to help.  Maybe you 
can help me revive this nice platform for Eu.

-- Brian

new topic     » goto parent     » topic index » view message » categorize

5. RE: Alpha Blending with EuAllegro

Howdy Brian Broker

>.. transparency in a percentage or something.  
> I'll check it out and get back
> to you (likely after the holiday).

Ok, its after the 4th of July. or was that not the holiday you were 
talking about ;-P

> I lost interest because it didn't seem like many others had much 
> interest
> (and I think that's also why Ray lost interest...).

Well, I'm interested since Euallegro seems to be the best solution to my 
graphics needs.

> I'll swing my focus back that way and see what I can do to help.  >Maybe 
> you can help me revive this nice platform for Eu.

I'll try. 
Do you think I should release demos of my game every time I make a major 
advancement? 
It might help with public awareness of the Euallegro library. :)

later,
LewyT

new topic     » goto parent     » topic index » view message » categorize

6. RE: Alpha Blending with EuAllegro

Lewis Townsend wrote:
> 
> 
> Howdy Brian Broker
> 
> >.. transparency in a percentage or something.  
> > I'll check it out and get back
> > to you (likely after the holiday).
> 
> Ok, its after the 4th of July. or was that not the holiday you were 
> talking about ;-P
> 
> > I lost interest because it didn't seem like many others had much 
> > interest
> > (and I think that's also why Ray lost interest...).
> 
> Well, I'm interested since Euallegro seems to be the best solution to my 
> 
> graphics needs.
> 
> > I'll swing my focus back that way and see what I can do to help.  >Maybe 
> > 
> > you can help me revive this nice platform for Eu.
> 
> I'll try. 
> Do you think I should release demos of my game every time I make a major 
> 
> advancement? 
> It might help with public awareness of the Euallegro library. :)
> 
> later,
> LewyT

My bad, I got caught up in some Win32Lib testing again.  As far as 
releasing demos... I wouldn't mind a preview to see if I can easily 
convert it to my version of the lib.  It might also help me to figure 
out the best solution for what you want to do.

Thanks,
-- Brian

new topic     » goto parent     » topic index » view message » categorize

7. RE: Alpha Blending with EuAllegro

I wrote:
> 
> Lewis Townsend wrote:
> > 
> > 
> > Howdy Brian Broker
> > 
> > >.. transparency in a percentage or something.  
> > > I'll check it out and get back
> > > to you (likely after the holiday).
> > 
> > Ok, its after the 4th of July. or was that not the holiday you were 
> > talking about ;-P
> > 
> > > I lost interest because it didn't seem like many others had much 
> > > interest
> > > (and I think that's also why Ray lost interest...).
> > 
> > Well, I'm interested since Euallegro seems to be the best solution to my 
> > 
> > 
> > graphics needs.
> > 
> > > I'll swing my focus back that way and see what I can do to help.  >Maybe 
> > > 
> > > 
> > > you can help me revive this nice platform for Eu.
> > 
> > I'll try. 
> > Do you think I should release demos of my game every time I make a major 
> > 
> > 
> > advancement? 
> > It might help with public awareness of the Euallegro library. :)
> > 
> > later,
> > LewyT
> 
> My bad, I got caught up in some Win32Lib testing again.  As far as 
> releasing demos... I wouldn't mind a preview to see if I can easily 
> convert it to my version of the lib.  It might also help me to figure 
> out the best solution for what you want to do.
> 
> Thanks,
> -- Brian
> 

Well, since I haven't heard back from you, I'll assume your program 
isn't ready for consumption.  Playing with my Allegro wrapper I came up 
with the following.  There might be a better way but this seemed to at 
least work:

-- note: alpha is a value between 0 and 255 --
procedure stretch_trans_sprite( atom bmp, atom sprite, integer x, 
integer y, integer size, integer alpha )
   integer nx, ny
   atom newsprite
 
   nx = bitmap_w(sprite)*size
   ny = bitmap_h(sprite)*size
   newsprite = create_bitmap( nx, ny )
   clear_to_color( newsprite, getpixel(sprite,0,0) )
   stretch_sprite( newsprite, sprite, 0, 0, nx, ny )
   set_trans_blender(0,0,0,alpha)
   draw_trans_sprite( bmp, newsprite, x, y )
   destroy_bitmap( newsprite )
end procedure


Let me know if this suits your needs...
-- Brian

new topic     » goto parent     » topic index » view message » categorize

8. RE: Alpha Blending with EuAllegro

Thanks Brian,

I guess I just had a couple of the parameters backwards in my attempts.
Now, I have something that works. 
Instead of combining stretchblit and transblit I will probably 
combine transblit and maskblit.
It makes more sense for my aplication.
Question: how can I use the apha channel from a bmp file to produce 
variable transparancy?
Example: an image of a man
the man is solid and opaque
the rest of the image is transparent
and the pixels along the man's outline are semitransparent
to produce an anti-alliased effect (smooth outlines)

TIA,
Lewy T

PS I uploaded a playable demo of the game today to Euphoria's website.

new topic     » goto parent     » topic index » view message » categorize

9. RE: Alpha Blending with EuAllegro

Lewis Townsend wrote:
> 
> Thanks Brian,
> 
> I guess I just had a couple of the parameters backwards in my attempts.
> Now, I have something that works. 
> Instead of combining stretchblit and transblit I will probably 
> combine transblit and maskblit.
> It makes more sense for my aplication.
> Question: how can I use the apha channel from a bmp file to produce 
> variable transparancy?
> Example: an image of a man
> the man is solid and opaque
> the rest of the image is transparent
> and the pixels along the man's outline are semitransparent
> to produce an anti-alliased effect (smooth outlines)
> 
> TIA,
> Lewy T
> 
> PS I uploaded a playable demo of the game today to Euphoria's website.
> 

I didn't know that the bmp format supported alpha-channel content; but
even if I did, I wouldn't know how to use it anyway.  I'll have to learn
more about how this all works before I can give you an answer.  But even 
if I figure out an answer, I'm not sure you'll get the desired  anti-
aliasing effect with that approach.

-- Brian
(d/l'ding demo now and looking forward to it...)

new topic     » goto parent     » topic index » view message » categorize

10. RE: Alpha Blending with EuAllegro

Brian,

Come to think of it, I'm not sure about the alpha channel in BMP files.
All I know is POV-Ray allows me to set alpha transparency in the output.
POV-Ray can output several different file types so maybe it only works
with other formats. What other formats could EuAllegro support?

LewyT

PS let me know if you have any trouble with the demo.

new topic     » goto parent     » topic index » view message » categorize

11. RE: Alpha Blending with EuAllegro

Lewis Townsend wrote:
> 
> LewyT
> 
> PS let me know if you have any trouble with the demo.

Yeah, I had trouble with the demo. I had trouble keeping my eyes
off her butt. sheesh! Put some clothes on, girl! :D

-=ck
"Programming in a state of EUPHORIA."

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu