SSH Productions: Module documentation for Digraphs.zip

Module: Digraphs 1.0, by SSH

Functions to translate strings into alternate characters for displaying foreign characters more easily, if a font has replaced unused characters with accented ones.

Download Digraphs 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

Functions to translate strings into alternate characters for

displaying foreign characters more easily, if a font has replaced unused

characters with accented ones.

Dependencies

AGS 2.71RC4 or later

Functions

  function Digraph.Set(String digraph, char to);

Set up a digraph. One would normally set up a bunch of these in

game_start so that they apply for the whole game. The two characters

specified in the string will be converted to the char value "to" when

the digraph-translation function is used.

String function Digraph.T(String from)

Translates the String passed are returns a modified string. If no

digraphs to translate, will return an identical string. A #define is

also setup to allow abbreviation of this function name to DG

Configuration

To allow more digraphs per accent to be set up, increase the number on the

line #defining MAX_DIGRAPHS below.

Example


  function game_start() {
    Digraph.Set("a'", '$'); // a acute
    Digraph.Set("e'", '!'); // e acute
    Digraph.Set("n~", '@'); // enye
  }
  function room_a() {
    // Room script: after room fadein
    Display(DG("Ole', mi espan~ola, que ta'l?"));
  }

Caveats

None yet.

Revision history

2 Dec 05 v1.00 Initial version

Licence

Digraphs AGS script module

Copyright (C) 2005 Andrew MacCormack

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to

deal in the Software without restriction, including without limitation the

rights to use, copy, modify, merge, publish, distribute, sublicense, and/or

sell copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in

all copies or substantial portions of the Software.

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.