Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[GM] Drawing Water


Mr.S

Recommended Posts

Thanks to Kain i have a very good water effect the only thing i am missing now is away to draw water. The way i used is to use a sprite but its horrible and its hard to build around. How can i draw water without use a big sprite, but with using a code ?

Cheers

Edit: Look at my sig thats what using a sprite for water looks like.

Link to comment
Share on other sites

All you need to do is draw a partially transparent blue rectangle, covering only the parts of the water you see. Code-wise, it'd be:

var y1, y2;

draw_set_alpha( 0.5);
draw_set_color(c_blue);

y1 = max( water_level, view_yview[0]);
y2 = max( water_level, view_yview[0] + view_hview[0]);

draw_rectangle( view_xview[0], y1, view_xview[0] + view_wview[0], y2);

You'd want to put that in an object with very low depth (something like -9999) so that it appears over the sprites and objects.

You could experiment with various blend modes (most notably bm_add), to get a better effect, but that's the basics.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...