• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Line of sight / Triangular surface

R

Rackover

Guest
Hi,
I've got a triangle, and I want to darken the screen completely excepted for this triangle : so the only thing I can see left is what's inside of it.

The triangle is not a sprite, but three separate points. I figured out I could draw black primitives all over the zones that are not inside the triangle, but I don't know how to do it. I could also draw big black rectangles on each side of the trianglee, but I can't seem to find a way to draw tilted rectangles.

Maybe I could get a triangular surface ? Then I could blacken the entire screen then draw the triangular surface on top of it. How could I do that ?

P.S. : I do not need my line of sight to be interrupted by objects or whatever. It's the simplest ever. However, this line of sight cannot be a sprite. It must be a triangle.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Create a black surface then use a subtractive blend mode and simply draw a black triangle over the part you want to view... :)
 
Top