SSH Productions: Module documentation for Zoom.zip

Module: Zoom 1.02, by SSH

Zoom in or out on sprite

Download Zoom as a zip file

Author

Andrew MacCormack (SSH)

Please use the PM function on the AGS forums to contact

me about problems with this module

Abstract

Provides a function to zoom in on an area of a sprite

Dependencies

AGS 2.71RC4 or later

Functions

Zoom.zoom(int sprite, float speed, float startscale, float endscale, int startx, int starty, int endx, int endy)

Zooms in on sprite from staring scale to ending scale.

speed is a multiplying factor for the scale at each step

endx and endy are the top-left coordinates of the area onscreen

to which the zooming will head towards

startx and starty are the inital coordinates of the top-left of the sprite

Zoom.zoomdone();

Returns 0 if currently zooming, 1 if not zooming.

Configuration

None required

Example


   // Zoom sprite 7 from normal size to 10x, heading towards location 200,80
   Zoom.zoom(7, 1.01, 1.0, 10.0, 0, 0, 200, 80);
   // Same again, but a bit faster
   Zoom.zoom(7, 1.02, 1.0, 10.0, 0, 0, 200, 80);
   // Zoom back out again
   Zoom.zoom(7, 1.02, 10.0, 1.0, 200, 80, 0, 0);

Caveats

Not tested with start or end scale of other than 1.0

this may give strange behaviours. Or, might just work.

Revision History

24 Nov 05: v1.0 First release of Zoom module

28 Nov 05: v1.01 Changed to repeatedly_execute_always

4 Aug 05: v1.02 Fixed so that it works in AGS v2.72

Licence

Zoom AGS script module

Copyright (C) 2005 Andrew MacCormack

This library is free software; you can redistribute it and/or

modify it under the terms of the GNU Lesser General Public

License as published by the Free Software Foundation; either

version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public

License along with this library; if not, write to the Free Software

Foundation, Inc, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

In addition to the licences mentioned in the modules themselves, you may choose to use the following creative commons licence if you prefer for all AGS modules and open source code resources on my site.

Creative Commons License
This work is licenced under a Creative Commons Licence.