SSH Productions: Module documentation for SmoothScrollInv.zip

Module: SmoothScrollInv 1.0, by SSH

Scroll InvWindows smoothly

Download SmoothScrollInv as a zip file

Author

Andrew MacCormack (SSH)

Please use the messaging function on the AGS forums to contact

me about problems with this module

Abstract

Allow invWindow GUI controls to scroll smoothly.

Dependencies

AGS 3.1.2 or later

Functions

function InvWindow.SmoothScrollPrev(ScrollDirection dir)

This invWindow method scrolls the window to previous inventory items either

eScrollHorizontal (1 item at a time) or eScrollVertical(a row at a time)

 function InvWindow.SmoothScrollNext(ScrollDirection dir);

This invWindow method scrolls the window to subsequent inventory items either

eScrollHorizontal (1 item at a time) or eScrollVertical(a row at a time)

Configuration

The speed of scrolling (pixels per game cycle) is set with the #define of

SCROLLSPEED below.

Example

  function goInvDown_OnClick(GUIControl *control, MouseButton button)
  {
    goInv.SmoothScrollNext(eScrollHorizontal);
  }

Caveats

The user must ensure that the GUI in which the InvWindow is contained clips off

the edges of the InvWindow when extended (i.e. is the same size as the InvWindow)

or that there are other GUI controls in front of the areas in which the scrolling

occurs. (The former is recommended)

The scrolling is blocking.

Revision History

25 Mar 09: v1.0 First release of SmoothScrollInv module

Licence

SmoothScrollInv AGS script module

Copyright (C) 2009 Andrew MacCormack

This module is licenced under the Creative Commons Attribution Share-alike

licence, (see http://creativecommons.org/licenses/by-sa/2.5/scotland/ )

which basically means do what you like as long as you credit me and don't

start selling modified copies of this module.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

DEALINGS IN THE SOFTWARE.

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.