Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: shaun9991 on Mon 15/12/2014 15:32:30

Title: Fixing in place a full screen object
Post by: shaun9991 on Mon 15/12/2014 15:32:30
Hi guys,

I'm playing around with rain animations. I have a walkable screen which is massive, something like 2000 x 800. The game resolution is 640x400. Is it possible to overlay a transparent object that is animating (rain), and have this fixed to cover the screen wherever the player is walking around? Does that make sense? Any help is much appreciated. I'm guessing it's something for repeatedly execute but I can't seem to get it right.

Thanks,

Shaun
Title: Re: Fixing in place a full screen object
Post by: Crimson Wizard on Mon 15/12/2014 15:34:35
Maybe just use transparent non-clickable GUI to draw rain over?
Title: Re: Fixing in place a full screen object
Post by: shaun9991 on Mon 15/12/2014 15:36:39
Of course :)

Thank you very much Crimson Wizard!

Title: Re: Fixing in place a full screen object
Post by: Crimson Wizard on Mon 15/12/2014 15:37:49
On other hand, I could be missing some drawbacks. I do not make games much :(.

As for the object, it should be fairly simple too:

Code (ags) Select

function repeatedly_execute_always()
{
   oRain.X = GetViewportX();
   oRain.Y = GetViewportY();
}
Title: Re: Fixing in place a full screen object
Post by: Calin Leafshade on Mon 15/12/2014 16:44:13
The origin of Objects is the bottom left. So you the Y coord would be GetViewportY() + System.ViewportHeight
Title: Re: Fixing in place a full screen object
Post by: shaun9991 on Tue 16/12/2014 15:07:52
Thanks guys, both of these work perfectly :)