Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Translucent Primitives in 32-Bit Mode

This thread is locked; no one can reply to it. rss feed Print
Translucent Primitives in 32-Bit Mode
Mr. Big
Member #6,196
September 2005

How do I draw a translucent triangle?
I read the manual but I still don't get it... (This is so embarrassing...)
Can anyone give me some example code?

umperio
Member #3,474
April 2003
avatar

Mr. Big
Member #6,196
September 2005

I checked out that webpage but none of the examples show up... ???
Anyway, according to the description, the example shows how to display translucent sprites.
I already know how to do that because there's that draw_trans_sprite function.
But how do I draw translucent primitives, like triangles?

Fladimir da Gorf
Member #1,565
October 2001
avatar

drawing_mode(DRAW_MODE_TRANS, 0, 0, 0);

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Mr. Big
Member #6,196
September 2005

Thanks!
But how do I make the color of the triangle translucent?
Should I use makeacol32?

Fladimir da Gorf
Member #1,565
October 2001
avatar

I think you have to use set_trans_blender for that.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Neil Walker
Member #210
April 2000
avatar

The website only contains references to the demos. You need to download the actual stuff to see them :)

If you've downloaded the binary from this site then that doesn't include the manuals, samples, demos, etc. just the library.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Tobias Dammers
Member #2,604
August 2002
avatar

Quote:

But how do I make the color of the triangle translucent?

That depends.
In any case, you need to set a trans blender (or a similar blending mode).
If you use the primitive triangle or polygon functions, then indeed it's set_drawing_mode() you're looking for. If you use the polygon rendering functions, then you need to pass a translucient polygon type (POLYTYPE_XXXX_TRANS).

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Thomas Fjellstrom
Member #476
June 2000
avatar

set_trans_blender for translucent primitives, and set_alpha_blender for using alpha masks.

--
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

Go to: