Forum Discussion

EnTerr's avatar
EnTerr
Roku Guru
12 years ago

How to draw a triangle?

I'd like to draw a solid triangle either to screen or a bitmap that i can later use - how is this simple task to be accomplished?
Triangle will be a simple color (no pattern), partially transparent (yes alpha). I am looking at ifDraw2D and see no means for that. Graphic libraries usually have a polygon-fill primitive, which i's even better - but i could live with a mere triangle (any polygon can be broken down to triangles anyway). No flood-fill either.

Drawing it with line segments, one end pinned at vertex A while the other end loops from B to C won't work - color intensity near A will be higher than near BC due to alpha blending/addition of the lines. Don't want to use pre-rasterized images in consideration of different screen resolutions (don't want diagonal lines jagged by scaling) - also the number of images needed will be too big to package with channel.

18 Replies