Jump to content


Photo

Underwater Surface Distortion?


  • Please log in to reply
2 replies to this topic

#1 Nefault1st

Nefault1st

    GMC Member

  • GMC Member
  • 100 posts
  • Version:GM8

Posted 17 June 2012 - 03:19 AM

Hi, I'm trying to make a distortion on the water in my game.
I found a good example here: http://gmc.yoyogames...howtopic=435740
but the problem is that it does the effect on the whole screen as if the water is that big.
what i tried to do is have the effect shown only on the water thats in parts of the level.

to make it easier for you to understand all this...

what i have is this:
Posted Image

what i want is this:
Posted Image
  • 0

#2 TheouAegis

TheouAegis

    GMC Member

  • GMC Member
  • 4672 posts
  • Version:GM8

Posted 17 June 2012 - 04:27 AM

Change the dimensions of the surface or only draw part of the surface. I didn't look at what you linked to, but from what I remember reading once (probably actually the same thread), it uses surfaces, so that's the solution.
  • 0

#3 Nefault1st

Nefault1st

    GMC Member

  • GMC Member
  • 100 posts
  • Version:GM8

Posted 30 June 2012 - 04:02 AM

Change the dimensions of the surface or only draw part of the surface. I didn't look at what you linked to, but from what I remember reading once (probably actually the same thread), it uses surfaces, so that's the solution.

It took me a week to figure this out but I finally got it to work. I tried to change the coordination and dimension of the water effect and I got was the water effect showing the whole screen on it. So what I did to fix that (this is for anyone that has this similar problem) was erase all the changes I made in the code and in the draw event change:
draw_surface(surf_draw,x,y)

into this:
draw_surface_part(surf_draw,x-view_xview,y-view_yview,("Water Object").sprite_width,("Water Objects Floor").y-("Water Object").y,x,y)

That way you only get the water effect only at the places that have a water area.
  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users