Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Is there a way to add opacity to a shape?

This thread is locked; no one can reply to it. rss feed Print
Is there a way to add opacity to a shape?
AleX-G Squadron
Member #13,593
October 2011
avatar

Hi guys!
I am searching for a way to create a square at the right of the screen in order to add points in there. Is there a way i can do this?
Also, the square must have an opacity(transparency).

www.anothergames.com

Matthew Leverton
Supreme Loser
January 1999
avatar

Yes, it can be done. Use primitives with the proper colors and blender.

Dizzy Egg
Member #10,824
March 2009
avatar

If your using Allegro 4.x you can use draw_trans_sprite after setting the blender; if your using Allegro 5 I'm stuck.

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

Thomas Fjellstrom
Member #476
June 2000
avatar

Dizzy Egg said:

If your using Allegro 4.x you can use draw_trans_sprite after setting the blender; if your using Allegro 5 I'm stuck.

Actually, in allegro 4, if you're using the primitives, you want to call drawing_mode to setup translucent drawing.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Desmond Taylor
Member #11,943
May 2010
avatar

and in Allegro 5 it's al_set_blender() and then al_draw_*()

Dizzy Egg
Member #10,824
March 2009
avatar

Thomas, I thought it was set_trans_blender() ?? I smoke a lot :(

EDIT:

Ahh using primitives, sorry :-[

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

Go to: