Engine functions

Reference for functions provided by the engine, each explained how they should be called from Ano script.

Audio functions

audio_cancel

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_cancel - Cancel playing audio track.

SYNOPSIS
    
    audio_cancel (
        (handle) AUDIO_HANDLE [required]
    )
    

DESCRIPTION
    Stop playing audio track immediately. Audio track must be already
    opened or created by audio_open() or one of the audio_create_*()
    functions. This function cancels only one audio track identified
    by AUDIO_HANDLE, if another tracks are playing simultaneously
    they are not affected.


    AUDIO_HANDLE is the handle of the audio track which to cancel
    and must be returned by one of the functions stated above.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and stop playing
    sleep (2, 0)
    audio_cancel (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_close

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_close - Close audio track.

SYNOPSIS
    
    audio_close (
        (handle) AUDIO_HANDLE [required]
    )
    

DESCRIPTION
    Close opened or created audio track. AUDIO_HANDLE must be valid
    handle returned by audio_open() or one of the audio_create_*()
    functions.  After call completes, audio track is gone for good
    and should not be referenced again.


    AUDIO_HANDLE is the handle of the audio track which to close
    and must be returned by one of the functions stated above.

EXAMPLE

    See audio_cancel.


Ano script                         2016-2023                     Ano script(3)

audio_create_noise_white

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_create_noise_white - Create white noise.

SYNOPSIS
    
    audio_create_noise_white (
        (double) SECONDS [required]
    )
    

DESCRIPTION
    Create some white noise. If creating the noise succeeds, internal
    variable rc has a handle for this audio track. Application must
    store this handle for later use and close the track by calling
    audio_close() when no longer needed.


    SECONDS of noise to be generated. Note that the whole length
    of noise is generated in internal buffer, so very large amount
    of noise can take a considerably amount of memory.

EXAMPLE

    See audio_solo.


Ano script                         2016-2023                     Ano script(3)

audio_create_wave_random

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_create_wave_random - Create random wave sound.

SYNOPSIS
    
    audio_create_wave_random (
        (double) SECONDS [required],
        (double) FREQUENCY [required],
        (double) AMPLITUDE [required]
    )
    

DESCRIPTION
    Create randomized wave sound. If creating the sound succeeds,
    internal variable rc has a handle for this audio track. Application
    must store this handle for later use and close the track by
    calling audio_close() when no longer needed.


    SECONDS of sound to be generated. Note that the whole length
    of sound is generated in internal buffer, so very large amount
    of sound can take a considerably amount of memory.


    FREQUENCY is the average frequency of the sound.


    AMPLITUDE is the amplitude of the sound, where range is from
    complete silence, 0.0 to maximum volume, 1.0.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Global uninitialized variables
    var     [handle] handle_audio

    ; Generate 5 second 400Hz (average) random wave using amplitude of
    ; 1.0 and play it, sounds a bit like when sitting in aeroplane
    audio_create_wave_random (5.0, 400.0, 1.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_play (handle_audio, 1.0, 0.0)
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_create_wave_sine

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_create_wave_sine - Create sine wave sound.

SYNOPSIS
    
    audio_create_wave_sine (
        (double) SECONDS [required],
        (double) FREQUENCY [required]
    )
    

DESCRIPTION
    Create sine wave sound. If creating the sound succeeds, internal
    variable rc has a handle for this audio track. Application must
    store this handle for later use and close the track by calling
    audio_close() when no longer needed.


    SECONDS of sound to be generated. Note that the whole length
    of sound is generated in internal buffer, so very large amount
    of sound can take a considerably amount of memory.


    FREQUENCY is the frequency of the sound.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Global uninitialized variables
    var     [handle] handle_audio

    ; Generate 5 second 440Hz sine wave and play it
    audio_create_wave_sine (5.0, 440.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_play (handle_audio, 1.0, 0.0)
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_create_wave_square

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_create_wave_square - Create square wave sound.

SYNOPSIS
    
    audio_create_wave_square (
        (double) SECONDS [required],
        (double) FREQUENCY [required]
    )
    

DESCRIPTION
    Create square wave sound. If creating the sound succeeds,
    internal variable rc has a handle for this audio track. Application
    must store this handle for later use and close the track by
    calling audio_close() when no longer needed.


    SECONDS of sound to be generated. Note that the whole length
    of sound is generated in internal buffer, so very large amount
    of sound can take a considerably amount of memory.


    FREQUENCY is the frequency of the sound.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Global uninitialized variables
    var     [handle] handle_audio

    ; Generate 5 second 440Hz square wave and play it
    audio_create_wave_square (5.0, 440.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_play (handle_audio, 1.0, 0.0)
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_cut

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_cut - Mute or unmute audio track.

SYNOPSIS
    
    audio_cut (
        (handle) AUDIO_HANDLE [required]
    )
    

DESCRIPTION
    Mute audio track if it is currently playing, or unmute audio
    track if it is currently muted. Audio track must be already
    opened or created by audio_open() or one of the audio_create_*()
    functions. This function affects only one audio track identified
    by AUDIO_HANDLE, if another tracks exists, they are not affected.


    AUDIO_HANDLE is the handle of the audio track which to cut and
    must be returned by one of the functions stated above.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and mute track...
    sleep (1, 0)
    audio_cut (handle_audio)

    ; ...and after a while unmute it
    sleep (1, 0)
    audio_cut (handle_audio)

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_hold

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_hold - Pause or resume audio track.

SYNOPSIS
    
    audio_hold (
        (handle) AUDIO_HANDLE [required]
    )
    

DESCRIPTION
    Pause audio track if it is currently playing, or resume audio
    track if it is currently paused. Audio track must be already
    opened or created by audio_open() or one of the audio_create_*()
    functions. This function affects only one audio track identified
    by AUDIO_HANDLE, if another tracks exists, they are not affected.


    AUDIO_HANDLE is the handle of the audio track which to hold and
    must be returned by one of the functions stated above.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and pause track...
    sleep (1, 0)
    audio_hold (handle_audio)

    ; ...and after a while resume it
    sleep (1, 0)
    audio_hold (handle_audio)

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_init

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_init - Initialize audio system.

SYNOPSIS
    
    audio_init
    

DESCRIPTION
    Initialize audio system. This call must be called before any
    other audio functions, like audio_open().  Initialization must
    be done only once in application lifetime.

EXAMPLE

    See audio_cancel.


Ano script                         2016-2023                     Ano script(3)

audio_master_dec

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_master_dec - Decrease master volume.

SYNOPSIS
    
    audio_master_dec (
        (float) VALUE [required]
    )
    

DESCRIPTION
    Decrease master volume by VALUE. Master volume range is from
    complete silence, 0.0 to maximum volume, 1.0, so decrementing
    VALUE of 0.1 from maximum volume causes current volume to be
    90% from maximum, or decrease by 1/10th, which way you want to
    look at it.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_master_set (1.0)
    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and decrease master volume by 50%
    sleep (2, 0)
    audio_master_dec (0.5)

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_master_get

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_master_get - Get master volume.

SYNOPSIS
    
    audio_master_get
    

DESCRIPTION
    Get current master volume value to internal variable rc.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_master_set (1.0)
    audio_master_get
    mov     vol (rc)
    dump    vol

    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and decrease master volume by 50%
    sleep (2, 0)
    audio_master_dec (0.5)
    audio_master_get
    mov     vol (rc)
    dump    vol

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_master_inc

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_master_inc - Increase master volume.

SYNOPSIS
    
    audio_master_inc (
        (float) VALUE [required]
    )
    

DESCRIPTION
    Increase master volume by VALUE. Master volume range is from
    complete silence, 0.0 to maximum volume, 1.0, so incrementing
    VALUE of 0.1 to current volume causes volume to increase by
    1/10th.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_master_set (0.25)
    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and increase master volume by 50%
    sleep (2, 0)
    audio_master_inc (0.5)

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_master_set

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_master_set - Set master volume.

SYNOPSIS
    
    audio_master_set (
        (float) VALUE [required]
    )
    

DESCRIPTION
    Set master volume to VALUE. Master volume range is from complete
    silence, 0.0 to maximum volume, 1.0.

EXAMPLE

    See audio_master_dec and audio_master_inc.


Ano script                         2016-2023                     Ano script(3)

audio_open

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_open - Open audio file.

SYNOPSIS
    
    audio_open (
        (string) AUDIO_FILE [required]
    )
    

DESCRIPTION
    Open audio file. If opening the audio file succeeds, internal
    variable rc has a handle for this audio track. Application must
    store this handle for later use and close the track by calling
    audio_close() when no longer needed. See example below. Supported
    file types includes the ones compiled in the engine, wave audio
    file format is always supported though.


    AUDIO_FILE must be the full path to audio file to be opened.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Global uninitialized variables
    var     [handle] handle_audio

    ; Open sound file and play it
    audio_open ([utf-8] "myaudio.wav")
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_play (handle_audio, 1.0, 0.0)

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_pan_dec

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_pan_dec - Decrease audio track panning.

SYNOPSIS
    
    audio_pan_dec (
        (handle) AUDIO_HANDLE [required],
        (float)  VALUE [required]
    )
    

DESCRIPTION
    Decrease panning of audio track. Audio track must be already
    opened or created by audio_open() or one of the audio_create_*()
    functions. Panning range is from leftmost position -1.0 to
    rightmost position 1.0, so decrementing the panning moves audio
    track towards the left side in stereo image.


    AUDIO_HANDLE is the handle of the audio track which panning to
    decrease and must be returned by one of the functions stated
    above.


    VALUE to decrement from current value.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_pan_set (handle_audio, 0.0)
    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and decrease panning by 50% from the center
    sleep (2, 0)
    audio_pan_dec (handle_audio, 0.5)

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_pan_get

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_pan_get - Get audio track panning.

SYNOPSIS
    
    audio_pan_get (
        (handle) AUDIO_HANDLE [required]
    )
    

DESCRIPTION
    Get current audio track panning value to internal variable rc.


    AUDIO_HANDLE is the handle of the audio track which panning
    value to get.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_pan_set (handle_audio, 0.0)
    audio_pan_get (handle_audio)
    mov     pan (rc)
    dump    pan

    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and decrease panning by 50% from the center
    sleep (2, 0)
    audio_pan_dec (handle_audio, 0.5)
    audio_pan_get (handle_audio)
    mov     pan (rc)
    dump    pan

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_pan_inc

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_pan_inc - Increase audio track panning.

SYNOPSIS
    
    audio_pan_inc (
        (handle) AUDIO_HANDLE [required],
        (float)  VALUE [required]
    )
    

DESCRIPTION
    Increase panning of audio track. Audio track must be already
    opened or created by audio_open() or one of the audio_create_*()
    functions. Panning range is from leftmost position -1.0 to
    rightmost position 1.0, so incrementing the panning moves audio
    track towards the right side in stereo image.


    AUDIO_HANDLE is the handle of the audio track which panning to
    increase and must be returned by one of the functions stated
    above.


    VALUE to increment to current value.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_pan_set (handle_audio, 0.0)
    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and increase panning by 50% from the center
    sleep (2, 0)
    audio_pan_inc (handle_audio, 0.5)

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_pan_set

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_pan_set - Set audio track panning.

SYNOPSIS
    
    audio_pan_set (
        (handle) AUDIO_HANDLE [required],
        (float)  VALUE [required]
    )
    

DESCRIPTION
    Set panning for audio track. Audio track must be already opened
    or created by audio_open() or one of the audio_create_*()
    functions. Panning range is from leftmost position, -1.0 to
    rightmost position, 1.0.


    AUDIO_HANDLE is the handle of the audio track which panning to
    set and must be returned by one of the functions stated above.


    VALUE audio track volume to set.

EXAMPLE

    See audio_pan_dec.


Ano script                         2016-2023                     Ano script(3)

audio_play

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_play - Play audio track.

SYNOPSIS
    
    audio_play (
        (handle) AUDIO_HANDLE [required],
        (float) VOLUME [required],
        (float) PAN [required]
    )
    

DESCRIPTION
    Play opened or created audio track. Audio track must be already
    opened or created by audio_open() or one of the audio_create_*()
    functions.


    AUDIO_HANDLE is the handle of the audio track which to play and
    must be returned by one of the functions stated above.


    VOLUME is volume for the track, where range is from complete
    silence, 0.0 to maximum volume, 1.0.


    PAN is panning range, from -1.0 to 1.0, where -1.0 is panned
    completely to left channel, 1.0 completely to right channel,
    and 0.0 is the center.

EXAMPLE

    See audio_open.


Ano script                         2016-2023                     Ano script(3)

audio_solo

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_solo - Mute or unmute other audio tracks.

SYNOPSIS
    
    audio_solo (
        (handle) AUDIO_HANDLE [required]
    )
    

DESCRIPTION
    Mute all other audio tracks currently playing, or unmute all
    other audio tracks currently muted. Solo audio track must be
    already opened or created by audio_open() or one of the
    audio_create_*() functions. This function affects all other
    audio tracks not identified by AUDIO_HANDLE, if another tracks
    exists. Soloing the track also unmutes or resumes it if it is
    either muted or paused.


    AUDIO_HANDLE is the handle of the audio track which to solo and
    must be returned by one of the functions stated above.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handles for the audio
    var     [handle] handle_audio_1
    var     [handle] handle_audio_2

    ; Generate 5 seconds of white noise
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error_1"
    mov     handle_audio_1 (rc)

    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error_2"
    mov     handle_audio_2 (rc)

    audio_play (handle_audio_1, 1.0, 0.0)
    audio_play (handle_audio_2, 1.0, 0.0)

    ; Sleep for a while and mute other track...
    sleep (1, 0)
    audio_solo (handle_audio_1)

    ; ...and after a while unmute it
    sleep (1, 0)
    audio_solo (handle_audio_1)

    ; Wait until audio finishes
    audio_wait (handle_audio_1)
    audio_close (handle_audio_2)
: "error_2"
    audio_close (handle_audio_1)

: "error_1"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_vol_dec

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_vol_dec - Decrease audio track volume.

SYNOPSIS
    
    audio_vol_dec (
        (handle) AUDIO_HANDLE [required],
        (float)  VALUE [required]
    )
    

DESCRIPTION
    Decrease volume of audio track. Audio track must be already
    opened or created by audio_open() or one of the audio_create_*()
    functions. Volume range is from complete silence, 0.0 to maximum
    volume, 1.0, so decrementing VALUE of 0.1 from maximum volume
    causes current volume to be 90% from maximum, or decrease by
    1/10th, which way you want to look at it.


    AUDIO_HANDLE is the handle of the audio track which volume to
    decrease and must be returned by one of the functions stated
    above.


    VALUE to decrement from current value.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_vol_set (handle_audio, 1.0)
    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and decrease volume by 50%
    sleep (2, 0)
    audio_vol_dec (handle_audio, 0.5)

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_vol_get

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_vol_get - Get audio track volume.

SYNOPSIS
    
    audio_vol_get (
        (handle) AUDIO_HANDLE [required]
    )
    

DESCRIPTION
    Get current audio track volume value to internal variable rc.


    AUDIO_HANDLE is the handle of the audio track which volume to
    get.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_vol_set (handle_audio, 1.0)
    audio_vol_get (handle_audio)
    mov     vol (rc)
    dump    vol

    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and decrease volume by 50%
    sleep (2, 0)
    audio_vol_dec (handle_audio, 0.5)
    audio_vol_get (handle_audio)
    mov     vol (rc)
    dump    vol

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_vol_inc

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_vol_inc - Increase audio track volume.

SYNOPSIS
    
    audio_vol_inc (
        (handle) AUDIO_HANDLE [required],
        (float)  VALUE [required]
    )
    

DESCRIPTION
    Increase volume of audio track. Audio track must be already
    opened or created by audio_open() or one of the audio_create_*()
    functions. Volume range is from complete silence, 0.0 to maximum
    volume, 1.0, so incrementing VALUE of 0.1 to current volume
    causes volume to increase by 1/10th.


    AUDIO_HANDLE is the handle of the audio track which volume to
    increase and must be returned by one of the functions stated
    above.


    VALUE to increment to current value.

EXAMPLE

    ; Initialize audio system
    audio_init

    ; Handle for the audio
    var     [handle] handle_audio

    ; Generate 5 seconds of white noise and play it
    audio_create_noise_white (5.0)
    cmp     rc (@0)
    je      "error"
    mov     handle_audio (rc)

    audio_vol_set (handle_audio, 0.25)
    audio_play (handle_audio, 1.0, 0.0)

    ; Sleep for a while and increase volume by 50%
    sleep (2, 0)
    audio_vol_inc (handle_audio, 0.5)

    ; Wait until audio finishes
    audio_wait (handle_audio)
    audio_close (handle_audio)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

audio_vol_set

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_vol_set - Set audio track volume.

SYNOPSIS
    
    audio_vol_set (
        (handle) AUDIO_HANDLE [required],
        (float)  VALUE [required]
    )
    

DESCRIPTION
    Set volume for audio track. Audio track must be already opened
    or created by audio_open() or one of the audio_create_*()
    functions. Volume range is from complete silence, 0.0 to maximum
    volume, 1.0.


    AUDIO_HANDLE is the handle of the audio track which volume to
    set and must be returned by one of the functions stated above.


    VALUE audio track volume to set.

EXAMPLE

    See audio_vol_dec.


Ano script                         2016-2023                     Ano script(3)

audio_wait

Ano script(3)               Ano function reference               Ano script(3)


NAME
    audio_wait - Wait until audio track completes.

SYNOPSIS
    
    audio_wait (
        (handle) AUDIO_HANDLE [required]
    )
    

DESCRIPTION
    Wait until audio track completes. Audio track must be already
    opened or created by audio_open() or one of the audio_create_*()
    functions.


    AUDIO_HANDLE is the handle of the audio track which to wait and
    must be returned by one of the functions stated above.

EXAMPLE

    See audio_open.


Ano script                         2016-2023                     Ano script(3)

Clock functions

clock_get_multiplier

Ano script(3)               Ano function reference               Ano script(3)


NAME
    clock_get_multiplier - Get internal clock resolution multiplier.

SYNOPSIS
    
    clock_get_multiplier"
    

DESCRIPTION
    Get internal clock resolution multiplier to internal variable
    rc.

EXAMPLE

    ; Global uninitialized variables
    var     [number] ticks
    var     [number] new_multiplier
    var     [number] old_multiplier

    ; Get system time in secs since epoch and set clock to that
    time
    mov     time (rc)
    dump    time

    clock_set (time)

    ; Get clock tick count
    clock_get_ticks
    mov     ticks (rc)
    dump    ticks

    ; Set clock multiplier to ten to make it run ten times faster
    clock_set_multiplier (10)
    mov     old_multiplier (rc)
    dump    old_multiplier

    ; Get current multiplier
    clock_get_multiplier
    mov     new_multiplier (rc)
    dump    new_multiplier

    ; Wait for a while to tick count to increase
    sleep (2, 0)

    ; Get clock tick count again
    clock_get_ticks
    mov     ticks (rc)
    dump    ticks

    exit


Ano script                         2016-2023                     Ano script(3)

clock_get_ticks

Ano script(3)               Ano function reference               Ano script(3)


NAME
    clock_get_ticks - Get internal clock tick count.

SYNOPSIS
    
    clock_get_ticks"
    

DESCRIPTION
    Get internal clock tick count, also known as stretching seconds,
    to internal variable rc.

EXAMPLE

    See clock_get_multiplier.


Ano script                         2016-2023                     Ano script(3)

clock_set

Ano script(3)               Ano function reference               Ano script(3)


NAME
    clock_set - Set internal clock tick count.

SYNOPSIS
    
    clock_set (
        (double) VALUE [required]
    )
    

DESCRIPTION
    Set internal clock tick count and return old tick count in
    internal variable rc.  Tick count affects the date what application
    thinks it is. Tick count usually follows system time(), and is
    set to that automatically when application starts. Tick count
    is advanced once per second, but can be either slowed down or
    speeded up by clock_set_multiplier() function.


    VALUE is the new clock tick count in seconds since epoch.

EXAMPLE

    See clock_get_multiplier.


Ano script                         2016-2023                     Ano script(3)

clock_set_multiplier

Ano script(3)               Ano function reference               Ano script(3)


NAME
    clock_set_multiplier - Set internal clock resolution multiplier.

SYNOPSIS
    
    clock_set_multiplier (
        (double) VALUE [required]
    )
    

DESCRIPTION
    Set internal clock resolution multiplier and return old multiplier
    in internal variable rc.  Multiplier affects internal clock
    speed, either slowing it down if value is less than 1.0, or
    speeding it up if value is greater than 1.0. Value of 1.0 is
    the default and makes clock run in realtime, and for example,
    value of 10.0 makes clock run ten times faster.


    VALUE to set to internal clock multiplier.

EXAMPLE

    See clock_get_multiplier.


Ano script                         2016-2023                     Ano script(3)

Color functions

color_brightness

Ano script(3)               Ano function reference               Ano script(3)


NAME
    color_brightness - Get color brightness.

SYNOPSIS
    
    color_brightness (
        (color) COLOR [required]
    )
    

DESCRIPTION
    Get color brightness and store it in internal variable rc.
    Brightness range is from 100% black, 0.0 to 100% white, 255.0.


    COLOR is the color which brightness to get.

EXAMPLE

    ; Global uninitialized variables
    var     [color] color

    mov     color ("indianred")

    ; Get color brightness
    color_brightness (color)
    mov     color (rc)
    dump    color

    exit


Ano script                         2016-2023                     Ano script(3)

color_complement

Ano script(3)               Ano function reference               Ano script(3)


NAME
    color_complement - Get complement color.

SYNOPSIS
    
    color_complement (
        (color) COLOR [required]
    )
    

DESCRIPTION
    Get complement color and store it in internal variable rc.


    COLOR is the color which complement to get.

EXAMPLE

    ; Global uninitialized variables
    var     [color] color

    mov     color ("indianred")

    ; Get color complement
    color_complement (color)
    mov     color (rc)
    dump    color

    exit


Ano script                         2016-2023                     Ano script(3)

color_mix

Ano script(3)               Ano function reference               Ano script(3)


NAME
    color_mix - Mix two colors together.

SYNOPSIS
    
    color_mix (
        (color) COLOR1 [required],
        (color) COLOR2 [required],
        (float) FACTOR [required]
    )
    

DESCRIPTION
    Mix two colors together by a factor and store mixed color in
    internal variable rc.  Mixing is done in natural way, for
    example, if you mix red and blue, you get somewhat brownish/violet
    color, not light magenta as mixing RGB values. Color tone can
    be further adjusted by adding, for example, a bit of yellow in
    the mix to make it look more natural, just like you would with
    oil colors.


    COLOR1 is the first color to be mixed.


    COLOR2 is the second color to be mixed.


    FACTOR is the mixing factor, ranging from 0.0 to 1.0.

EXAMPLE

    ; Global uninitialized variables
    var     [color] color1
    var     [color] color2

    mov     color1 ("indianred")
    mov     color2 ("steelblue")

    ; Mix two colors together using factor 0.5
    color_mix (color1, color2, 0.5)
    mov     color1 (rc)
    dump    color1

    exit


Ano script                         2016-2023                     Ano script(3)

Coordinate functions

coords_dot_product

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_dot_product - Get dot product of two points.

SYNOPSIS
    
    coords_dot_product (
        (point) POINT1 [required],
        (point) POINT2 [required]
    )
    

DESCRIPTION
    Get dot product of two points and store it in internal variable
    rc.


    POINT1 is the first point.


    POINT2 is the second point.

EXAMPLE

    ; Global initialized variables
    mov     point1 (& 1.1, 2.2, 3.3)
    mov     point2 (& 4.4, 5.5, 6.6)

    ; Get dot product of two points
    coords_dot_product (point1, point2)
    mov     dot (rc)
    dump    dot

    exit


Ano script                         2016-2023                     Ano script(3)

coords_get_angle

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_get_angle - Get angle of point.

SYNOPSIS
    
    coords_get_angle (
        (point) POINT [required]
    )
    

DESCRIPTION
    Get angle of point in degrees from origin (x = 0.0, y = 0.0, z
    = 0.0) and store it in internal variable rc.  Only x and y
    coordinates are effective, so calculating the angle works only
    in two dimensional plane.


    POINT is the point which angle to get.

EXAMPLE

    ; Global initialized variables
    mov     point (& 1.1, 2.2, 0.0)

    ; Get point angle from origin, x = 0.0, y = 0.0, z = 0.0
    coords_get_angle (point)
    mov     angle (rc)
    dump    angle

    exit


Ano script                         2016-2023                     Ano script(3)

coords_difference_2d

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_difference_2d - Get difference of two points.

SYNOPSIS
    
    coords_difference_2d (
        (point) POINT1 [required],
        (point) POINT2 [required]
    )
    

DESCRIPTION
    Get difference of two dimensional points and store it in internal
    variable rc.


    POINT1 is the first point.


    POINT2 is the second point.

EXAMPLE

    ; Global initialized variables
    mov     point1 (& 1.1, 2.2, 0.0)
    mov     point2 (& 3.3, 4.4, 0.0)

    ; Get difference of two points
    coords_difference_2d (point1, point2)
    mov     diff (rc)
    dump    diff

    exit


Ano script                         2016-2023                     Ano script(3)

coords_difference_3d

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_difference_3d - Get difference of two points.

SYNOPSIS
    
    coords_difference_3d (
        (point) POINT1 [required],
        (point) POINT2 [required]
    )
    

DESCRIPTION
    Get difference of three dimensional points and store it in
    internal variable rc.


    POINT1 is the first point.


    POINT2 is the second point.

EXAMPLE

    ; Global initialized variables
    mov     point1 (& 1.1, 2.2, 3.3)
    mov     point2 (& 4.4, 5.5, 6.6)

    ; Get difference of two points
    coords_difference_3d (point1, point2)
    mov     diff (rc)
    dump    diff

    exit


Ano script                         2016-2023                     Ano script(3)

coords_mag_2d

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_mag_2d - Get magnitude of point.

SYNOPSIS
    
    coords_mag_2d (
        (point) POINT [required]
    )
    

DESCRIPTION
    Get magnitude of two dimensional point and store it in internal
    variable rc.


    POINT is the point.

EXAMPLE

    ; Global initialized variables
    mov     point1 (& 1.1, 2.2, 0.0)
    mov     point2 (& 3.3, 4.4, 0.0)

    sub     point2 (point1)

    ; Get the magnitude
    coords_mag_2d (point2)
    mov     dist (rc)
    dump    dist

    exit


Ano script                         2016-2023                     Ano script(3)

coords_mag_3d

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_mag_3d - Get magnitude of point.

SYNOPSIS
    
    coords_mag_3d (
        (point) POINT [required]
    )
    

DESCRIPTION
    Get magnitude of three dimensional point and store it in internal
    variable rc.


    POINT is the point.

EXAMPLE

    ; Global initialized variables
    mov     point1 (& 1.1, 2.2, 3.3)
    mov     point2 (& 4.4, 5.5, 6.6)

    sub     point2 (point1)

    ; Get the magnitude
    coords_mag_3d (point2)
    mov     dist (rc)
    dump    dist

    exit


Ano script                         2016-2023                     Ano script(3)

coords_get_pos

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_get_pos - Get point position by angle and distance.

SYNOPSIS
    
    coords_get_pos (
        (double) ANGLE [required],
        (double) DISTANCE [required]
    )
    

DESCRIPTION
    Get point position by angle and distance and store it in internal
    variable rc.


    ANGLE in degrees of the point.


    DISTANCE from origin.

EXAMPLE

    ; Global uninitialized variables
    var     [point] point

    ; Get point position
    coords_get_pos (45.0, 10.0)
    mov     point (rc)
    dump    point

    exit


Ano script                         2016-2023                     Ano script(3)

coords_intp_catmull_x

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_catmull_x - Catmull-Rom interpolation along x axis.

SYNOPSIS
    
    coords_intp_catmull_x (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (point)  POINT3 [required],
        (point)  POINT4 [required],
        (double) INTERPOLATION_POINT [required]
    )
    

DESCRIPTION
    Interpolate INTERPOLATION_POINT between control points POINT2
    and POINT3 and stores it in internal variable rc.  The additional
    control points, POINT1 and POINT4 are used to adjust the shape
    of the curve by implicitly defining tangents.


    POINT2,3 are the control points for interpolation.


    POINT1,4 are the additional control points to adjust the curve
    shape.


    INTERPOLATION_POINT between POINT2 and POINT3, range is from
    0.0 to 1.0, 0.5 is halfway between POINT2 and POINT3.

EXAMPLE

    ; Set initial points for interpolation
    mov     point1 (& -1.1, 0.0, 0.0)
    mov     point2 (& -1.1, -0.75, 0.0)
    mov     point3 (& 1.9, 0.75, 0.0)
    mov     point4 (& 1.9, 0.0, 0.0)

    ; Set interpolation point
    mov     intp (0.0)

    ; Loop for ten interpolation points
    mov     ecx (10)
: "loop"

    coords_intp_catmull_x (point1, point2, point3, point4, intp)
    mov     pos_x (rc)
    dump    pos_x

    coords_intp_catmull_y (point1, point2, point3, point4, intp)
    mov     pos_y (rc)
    dump    pos_y

    add     intp (0.1)

    dec     ecx
    jnz     "loop"

    exit


Ano script                         2016-2023                     Ano script(3)

coords_intp_catmull_y

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_catmull_y - Catmull-Rom interpolation along y axis.

SYNOPSIS
    
    coords_intp_catmull_y (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (point)  POINT3 [required],
        (point)  POINT4 [required],
        (double) INTERPOLATION_POINT [required]
    )
    

DESCRIPTION
    See coords_intp_catmull_x.

EXAMPLE

    See coords_intp_catmull_x.


Ano script                         2016-2023                     Ano script(3)

coords_intp_catmull_z

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_catmull_z - Catmull-Rom interpolation along z axis.

SYNOPSIS
    
    coords_intp_catmull_z (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (point)  POINT3 [required],
        (point)  POINT4 [required],
        (double) INTERPOLATION_POINT [required]
    )
    

DESCRIPTION
    See coords_intp_catmull_x.

EXAMPLE

    See coords_intp_catmull_x.


Ano script                         2016-2023                     Ano script(3)

coords_intp_cubic_x

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_cubic_x - Cubic interpolation along x axis.

SYNOPSIS
    
    coords_intp_cubic_x (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (point)  POINT3 [required],
        (point)  POINT4 [required],
        (double) INTERPOLATION_POINT [required]
    )
    

DESCRIPTION
    See coords_intp_catmull_x.

EXAMPLE

    See coords_intp_catmull_x.


Ano script                         2016-2023                     Ano script(3)

coords_intp_cubic_y

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_cubic_y - Cubic interpolation along y axis.

SYNOPSIS
    
    coords_intp_cubic_y (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (point)  POINT3 [required],
        (point)  POINT4 [required],
        (double) INTERPOLATION_POINT [required]
    )
    

DESCRIPTION
    See coords_intp_cubic_x.

EXAMPLE

    See coords_intp_cubic_x.


Ano script                         2016-2023                     Ano script(3)

coords_intp_cubic_z

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_cubic_z - Cubic interpolation along z axis.

SYNOPSIS
    
    coords_intp_cubic_z (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (point)  POINT3 [required],
        (point)  POINT4 [required],
        (double) INTERPOLATION_POINT [required]
    )
    

DESCRIPTION
    See coords_intp_cubic_x.

EXAMPLE

    See coords_intp_cubic_x.


Ano script                         2016-2023                     Ano script(3)

coords_intp_hermite_x

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_hermite_x - Hermite interpolation along x axis.

SYNOPSIS
    
    coords_intp_hermite_x (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (point)  POINT3 [required],
        (point)  POINT4 [required],
        (double) INTERPOLATION_POINT [required],
        (double) BIAS [required],
        (double) TENSION [required]
    )
    

DESCRIPTION
    Interpolate INTERPOLATION_POINT between control points POINT2
    and POINT3 and stores it in internal variable rc.  The additional
    control points, POINT1 and POINT4 are used to adjust the shape
    of the curve by implicitly defining tangents.


    POINT2,3 are the control points for interpolation.


    POINT1,4 are the additional control points to adjust the curve
    shape.


    INTERPOLATION_POINT between POINT2 and POINT3, range is from
    0.0 to 1.0, 0.5 is halfway between POINT2 and POINT3.


    BIAS 0.0 is even, >0.0 towards the POINT2, <0.0 towards
    the POINT3.


    TENSION 1.0 is high, 0.0 is normal, -1.0 is low.

EXAMPLE

    ; Set initial points for interpolation
    mov     point1 (& -1.1, 0.0, 0.0)
    mov     point2 (& -1.1, -0.75, 0.0)
    mov     point3 (& 1.9, 0.75, 0.0)
    mov     point4 (& 1.9, 0.0, 0.0)

    ; Set interpolation point, bias and tension
    mov     intp (0.0)
    mov     bias (0.0)
    mov     tension (0.0)

    ; Loop for ten interpolation points
    mov     ecx (10)
: "loop"

    coords_intp_hermite_x (point1, point2, point3, point4, intp, bias, tension)
    mov     pos_x (rc)
    dump    pos_x

    coords_intp_hermite_y (point1, point2, point3, point4, intp, bias, tension)
    mov     pos_y (rc)
    dump    pos_y

    add     intp (0.1)

    dec     ecx
    jnz     "loop"

    exit


Ano script                         2016-2023                     Ano script(3)

coords_intp_hermite_y

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_hermite_y - Hermite interpolation along y axis.

SYNOPSIS
    
    coords_intp_hermite_y (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (point)  POINT3 [required],
        (point)  POINT4 [required],
        (double) INTERPOLATION_POINT [required],
        (double) BIAS [required],
        (double) TENSION [required]
    )
    

DESCRIPTION
    See coords_intp_hermite_x.

EXAMPLE

    See coords_intp_hermite_x.


Ano script                         2016-2023                     Ano script(3)

coords_intp_hermite_z

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_hermite_z - Hermite interpolation along z axis.

SYNOPSIS
    
    coords_intp_hermite_z (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (point)  POINT3 [required],
        (point)  POINT4 [required],
        (double) INTERPOLATION_POINT [required],
        (double) BIAS [required],
        (double) TENSION [required]
    )
    

DESCRIPTION
    See coords_intp_hermite_x.

EXAMPLE

    See coords_intp_hermite_x.


Ano script                         2016-2023                     Ano script(3)

coords_intp_linear_x

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_linear_x - Linear interpolation along x axis.

SYNOPSIS
    
    coords_intp_linear_x (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (double) INTERPOLATION_POINT [required]
    )
    

DESCRIPTION
    Interpolate INTERPOLATION_POINT between control points POINT1
    and POINT2 and stores it in internal variable rc.


    POINT1,2 are the control points for interpolation.


    INTERPOLATION_POINT between POINT1 and POINT2, range is from
    0.0 to 1.0, 0.5 is halfway between POINT1 and POINT2.

EXAMPLE

    ; Set initial points for interpolation
    mov     point1 (& -1.1, -0.75, 0.0)
    mov     point2 (& 1.9, 0.75, 0.0)

    ; Set interpolation point
    mov     intp (0.0)

    ; Loop for ten interpolation points
    mov     ecx (10)
: "loop"

    coords_intp_linear_x (point1, point2, intp)
    mov     pos_x (rc)
    dump    pos_x

    coords_intp_linear_y (point1, point2, intp)
    mov     pos_y (rc)
    dump    pos_y

    add     intp (0.1)

    dec     ecx
    jnz     "loop"

    exit


Ano script                         2016-2023                     Ano script(3)

coords_intp_linear_y

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_linear_y - Linear interpolation along y axis.

SYNOPSIS
    
    coords_intp_linear_y (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (double) INTERPOLATION_POINT [required]
    )
    

DESCRIPTION
    See coords_intp_linear_x.

EXAMPLE

    See coords_intp_linear_x.


Ano script                         2016-2023                     Ano script(3)

coords_intp_linear_z

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_intp_linear_z - Linear interpolation along z axis.

SYNOPSIS
    
    coords_intp_linear_z (
        (point)  POINT1 [required],
        (point)  POINT2 [required],
        (double) INTERPOLATION_POINT [required]
    )
    

DESCRIPTION
    See coords_intp_linear_x.

EXAMPLE

    See coords_intp_linear_x.


Ano script                         2016-2023                     Ano script(3)

coords_normalize

Ano script(3)               Ano function reference               Ano script(3)


NAME
    coords_normalize - Normalize point.

SYNOPSIS
    
    coords_normalize (
        (point) POINT [required]
    )
    

DESCRIPTION
    Normalize point and store it in internal variable rc.


    POINT to normalize.

EXAMPLE

    ; Global initialized variables
    mov     point (& 1.1, 2.2, 3.3)

    ; Get normalized point
    coords_normalize (point)
    mov     normal (rc)
    dump    normal

    exit


Ano script                         2016-2023                     Ano script(3)

Drawing functions

draw_border

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_border - Draw rectangular border to window.

SYNOPSIS
    
    draw_border (
        (handle) WINDOW_HANDLE [required],
        (int)    POSITION_X [required],
        (int)    POSITION_Y [required],
        (uint)   WIDTH [required],
        (uint)   HEIGHT [required],
        (uint)   THICKNESS [required],
        (color)  COLOR [required]
    )
    

DESCRIPTION
    Draw rectangular border to window.


    WINDOW_HANDLE is the handle of the window where to draw and
    must be returned by window_open().


    POSITION_X is the horizontal position of border's upper-left
    corner in pixels.


    POSITION_Y is the vertical position of border's upper-left
    corner in pixels.


    WIDTH is the width of the border in pixels.


    HEIGHT is the height of the border in pixels.


    THICKNESS is the thickness of the border in pixels.


    COLOR is the color for the border.

EXAMPLE

    ; ...open window here first, see window_open...

    mov     border_color ("cyanwhite")

    draw_border (window_handle, 10, 100, 10, 10, 1, border_color)

    end


Ano script                         2016-2023                     Ano script(3)

draw_border_alpha

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_border_alpha - Draw rectangular border with alpha value to window.

SYNOPSIS
    
    draw_border_alpha (
        (handle) WINDOW_HANDLE [required],
        (int)    POSITION_X [required],
        (int)    POSITION_Y [required],
        (uint)   WIDTH [required],
        (uint)   HEIGHT [required],
        (uint)   THICKNESS [required],
        (color)  COLOR [required]
    )
    

DESCRIPTION
    Draw rectangular border with alpha value to window. Alpha value
    is specified by COLOR alpha component.


    WINDOW_HANDLE is the handle of the window where to draw and
    must be returned by window_open().


    POSITION_X is the horizontal position of border's upper-left
    corner in pixels.


    POSITION_Y is the vertical position of border's upper-left
    corner in pixels.


    WIDTH is the width of the border in pixels.


    HEIGHT is the height of the border in pixels.


    THICKNESS is the thickness of the border in pixels.


    COLOR is the color and alpha value for the border.

EXAMPLE

    ; ...open window here first, see window_open...

    mov     border_color ("cyanwhite")

    draw_border_alpha (window_handle, 30, 100, 10, 10, 3, border_color)

    end


Ano script                         2016-2023                     Ano script(3)

draw_copy

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_copy - Copy region.

SYNOPSIS
    
    draw_copy (
        (handle) WINDOW_HANDLE [required],
        (int)    SOURCE_AREA_X [required],
        (int)    SOURCE_AREA_Y [required],
        (int)    DESTINATION_AREA_X [required],
        (int)    DESTINATION_AREA_Y [required],
        (uint)   AREA_WIDTH [required],
        (uint)   AREA_HEIGHT [required]
    )
    

DESCRIPTION
    Copy block in window from source to destination. Source and
    destination regions may not overlap.


    WINDOW_HANDLE is the handle of the window to wipe and must be
    returned by window_open().

EXAMPLE

    ; ...open window here first, see window_open...

    ; Copy 50x50 pixel block from 0, 0 to 100, 100
    draw_copy_alpha (window_handle, 0, 0, 100, 100, 50, 50)

    end


Ano script                         2016-2023                     Ano script(3)

draw_copy_alpha

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_copy_alpha - Copy region with alpha value.

SYNOPSIS
    
    draw_copy_alpha (
        (handle) WINDOW_HANDLE [required],
        (int)    SOURCE_AREA_X [required],
        (int)    SOURCE_AREA_Y [required],
        (int)    DESTINATION_AREA_X [required],
        (int)    DESTINATION_AREA_Y [required],
        (uint)   AREA_WIDTH [required],
        (uint)   AREA_HEIGHT [required]
    )
    

DESCRIPTION
    Copy block in window from source to destination, making destination
    block pixels possibly translucent according to pixels alpha
    value. Source and destination regions may not overlap.


    WINDOW_HANDLE is the handle of the window to wipe and must be
    returned by window_open().

EXAMPLE

    ; ...open window here first, see window_open...

    ; Copy 50x50 pixel block from 0, 0 to 100, 100
    draw_copy_alpha (window_handle, 0, 0, 100, 100, 50, 50)

    end


Ano script                         2016-2023                     Ano script(3)

draw_pixel

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_pixel - Draw pixel to window.

SYNOPSIS
    
    draw_pixel (
        (handle) WINDOW_HANDLE [required],
        (int)    POSITION_X [required],
        (int)    POSITION_Y [required],
        (color)  COLOR [required]
    )
    

DESCRIPTION
    Draw pixel to window.


    WINDOW_HANDLE is the handle of the window where to draw and
    must be returned by window_open().


    POSITION_X is the window X-coordinate for the pixel.


    POSITION_Y is the window Y-coordinate for the pixel.


    COLOR is the color for the pixel.

EXAMPLE

    ; ...open window here first, see window_open...

    mov     pixel_color ("cyanwhite")

    draw_pixel (window_handle, 10, 10, pixel_color)

    end


Ano script                         2016-2023                     Ano script(3)

draw_pixel_alpha

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_pixel_alpha - Draw pixel with alpha value to window.

SYNOPSIS
    
    draw_pixel_alpha (
        (handle) WINDOW_HANDLE [required],
        (int)    POSITION_X [required],
        (int)    POSITION_Y [required],
        (color)  COLOR [required]
    )
    

DESCRIPTION
    Draw pixel with alpha value to window.


    WINDOW_HANDLE is the handle of the window where to draw and
    must be returned by window_open().


    POSITION_X is the window X-coordinate for the pixel.


    POSITION_Y is the window Y-coordinate for the pixel.


    COLOR is the color and alpha value for the pixel.

EXAMPLE

    ; ...open window here first, see window_open...

    mov     pixel_color ("cyanwhite")

    draw_pixel_alpha (window_handle, 10, 10, pixel_color)

    end


Ano script                         2016-2023                     Ano script(3)

draw_set

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_set - Fill region.

SYNOPSIS
    
    draw_set (
        (handle) WINDOW_HANDLE [required],
        (int)    START_X [required],
        (int)    START_Y [required],
        (int)    END_X [required],
        (int)    END_Y [required],
        (color)  COLOR [required]
    )
    

DESCRIPTION
    Fill region with color.


    WINDOW_HANDLE is the handle of the window where to draw and
    must be returned by window_open().


    COLOR is the color for the block.

EXAMPLE

    ; ...open window here first, see window_open...

    mov     block_color ("cyanwhite")

    ; Set ten pixel block from 10, 10 to 20, 20
    draw_set (window_handle, 10, 10, 20, 20, block_color)

    end


Ano script                         2016-2023                     Ano script(3)

draw_set_alpha

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_set_alpha - Fill region with alpha value.

SYNOPSIS
    
    draw_set_alpha (
        (handle) WINDOW_HANDLE [required],
        (int)    START_X [required],
        (int)    START_Y [required],
        (int)    END_X [required],
        (int)    END_Y [required],
        (color)  COLOR [required]
    )
    

DESCRIPTION
    Fill region with color and alpha value making it possible
    translucent.


    WINDOW_HANDLE is the handle of the window where to draw and
    must be returned by window_open().


    COLOR is the color and alpha value for the block.

EXAMPLE

    ; ...open window here first, see window_open...

    mov     block_color ("cyanwhite")

    ; Set ten pixel block from 10, 10 to 20, 20
    draw_set_alpha (window_handle, 10, 10, 20, 20, block_color)

    end


Ano script                         2016-2023                     Ano script(3)

draw_subpixel

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_subpixel - Draw subpixel to window.

SYNOPSIS
    
    draw_subpixel (
        (handle) WINDOW_HANDLE [required],
        (double) POSITION_X [required],
        (double) POSITION_Y [required],
        (color)  COLOR [required]
    )
    

DESCRIPTION
    Draw subpixel to window. Subpixel can be drawn between two
    adjacent pixels, for example setting POSITION_X to 1.5 it is
    exactly middle of second and third pixel.


    WINDOW_HANDLE is the handle of the window where to draw and
    must be returned by window_open().


    POSITION_X is the window X-coordinate for the pixel.


    POSITION_Y is the window Y-coordinate for the pixel.


    COLOR is the color for the pixel.

EXAMPLE

    ; ...open window here first, see window_open...

    mov     pixel_color ("cyanwhite")

    draw_subpixel (window_handle, 1.25, 1.0, pixel_color)

    end


Ano script                         2016-2023                     Ano script(3)

draw_subpixel_alpha

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_subpixel_alpha - Draw subpixel with alpha value to window.

SYNOPSIS
    
    draw_subpixel_alpha (
        (handle) WINDOW_HANDLE [required],
        (double) POSITION_X [required],
        (double) POSITION_Y [required],
        (color)  COLOR [required]
    )
    

DESCRIPTION
    Draw subpixel with alpha value to window. Subpixel can be drawn
    between two adjacent pixels, for example setting POSITION_X to
    1.5 it is exactly middle of second and third pixel.


    WINDOW_HANDLE is the handle of the window where to draw and
    must be returned by window_open().


    POSITION_X is the window X-coordinate for the pixel.


    POSITION_Y is the window Y-coordinate for the pixel.


    COLOR is the color and alpha value for the pixel.

EXAMPLE

    ; ...open window here first, see window_open...

    mov     pixel_color ("cyanwhite")

    draw_subpixel_alpha (window_handle, 1.25, 1.0, pixel_color)

    end


Ano script                         2016-2023                     Ano script(3)

draw_text

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_text - Draw rendered text to window.

SYNOPSIS
    
    draw_text (
        (handle) WINDOW_HANDLE [required],
        (handle) FONT_HANDLE [required],
        (int)    POSITION_X [required],
        (int)    POSITION_Y [required]
    )
    

DESCRIPTION
    Draw rendered text to window. Text must be already rendered by
    font_render().


    WINDOW_HANDLE is the handle of the window where to draw and
    must be returned by window_open().


    FONT_HANDLE is the handle of the font to use for rendering
    returned by font_open().


    POSITION_X and POSITION_Y are text coordinates in pixels measured
    from upper left corner.

EXAMPLE

    ; ...open window here first, see window_open...

    ; Variable type is handle
    var     [handle] font_handle

    ; String to be rendered
    mov     string ("Make my Mojo working baby!")

    ; Open font or bail out if failed
    mov     font_file ("myfont.ttf")
    mov     font_size ([uint] 12)
    mov     font_dpi ([uint] 100)
    mov     font_color ("cyanwhite")

    font_open (font_file, font_size, font_dpi)
    cmp     rc (@0)
    je      "error"

    ; Store font handle for later use
    mov     font_handle (rc)

    ; Render text to be displayed
    font_render (font_handle, NULL, string, [uint] 0, font_color)

    ; Erase window and draw rendered text
    draw_wipe (window_handle)
    draw_text (window_handle, font_handle, [int] 10, [int] 10)

    ; Close font when no longer needed
    font_close (font_handle)

: "error"
    exit


Ano script                         2016-2023                     Ano script(3)

draw_wipe

Ano script(3)               Ano function reference               Ano script(3)


NAME
    draw_wipe - Erase window active content.

SYNOPSIS
    
    draw_wipe (
        (handle) WINDOW_HANDLE [required]
    )
    

DESCRIPTION
    Erase window active content. Erasing means that window active
    area is filled completely with zeroes.


    WINDOW_HANDLE is the handle of the window to wipe and must be
    returned by window_open().

EXAMPLE

    See draw_text.


Ano script                         2016-2023                     Ano script(3)

Font functions

font_close

Ano script(3)               Ano function reference               Ano script(3)


NAME
    font_close - Close opened font.

SYNOPSIS
    
    font_close (
        (handle) FONT_HANDLE [required]
    )
    

DESCRIPTION
    Close opened font. FONT_HANDLE must be valid handle returned
    by font_open(). After call completes, font is gone for good and
    should not be referenced again.

EXAMPLE

    See draw_text.


Ano script                         2016-2023                     Ano script(3)

font_open

Ano script(3)               Ano function reference               Ano script(3)


NAME
    font_open - Open new font face.

SYNOPSIS
    
    font_open (
        (string) FONT_FILE [required],
        (uint)   FONT_SIZE [required],
        (uint)   FONT_RESOLUTION [optional]
    )
    

DESCRIPTION
    Open new font face. If opening the font succeeds, internal
    variable rc has a handle for this font. Application must store
    this handle for later use. See example below.


    FONT_FILE must be the full path to font file to be opened.


    FONT_SIZE is the size of desired face in 1/64 points.


    FONT_RESOLUTION is the resolution of desired face in dots per
    inch. If FONT_RESOLUTION is zero, then screen default resolution
    is used.

EXAMPLE

    See draw_text.


Ano script                         2016-2023                     Ano script(3)

font_render

Ano script(3)               Ano function reference               Ano script(3)


NAME
    font_render - Render text to internal buffer.

SYNOPSIS
    
    font_render (
        (handle) FONT_HANDLE [required],
        (string) STRING_CHARSET [optional],
        (string) STRING [required],
        (uint)   STRING_LENGTH [optional],
        (color)  COLOR [required]
    )
    

DESCRIPTION
    Render text to internal buffer to be displayed later. Use
    draw_text() to display rendered text. Rendered text can be
    displayed until font is closed without the need of re-rendering.


    FONT_HANDLE is the handle returned by font_open().


    STRING_CHARSET is character set name to be used when rendering.
    Character set must be understandable by iconv().


    STRING is the actual string to be rendered.


    If STRING_LENGTH is zero, whole STRING is rendered, otherwise
    only STRING_LENGTH characters are rendered.


    COLOR is the color for the STRING.

EXAMPLE

    See draw_text.


Ano script                         2016-2023                     Ano script(3)

Math functions

math_clamp

Ano script(3)               Ano function reference               Ano script(3)


NAME
    math_clamp - Clamp value to range.

SYNOPSIS
    
    math_clamp (
        (double) VALUE [required],
        (double) MIN [required],
        (double) MAX [required]
    )
    

DESCRIPTION
    Clamp value to range of MIN and MAX and store it in internal
    variable rc.


    VALUE is the value to clamp.


    MIN is the minimum border for value.


    MAX is the maximum border for value.

EXAMPLE

    ; Global uninitialized variables
    var     [number] value

    ; Clamp value between min and max
    math_clamp (0.5, 1.0, 2.0)
    mov     value (rc)
    dump    value

    exit


Ano script                         2016-2023                     Ano script(3)

math_get_hcf

Ano script(3)               Ano function reference               Ano script(3)


NAME
    math_get_hcf - Get highest common factor.

SYNOPSIS
    
    math_get_hcf (
        (double) VALUE1 [required],
        (double) VALUE2 [required]
    )
    

DESCRIPTION
    Get highest common value and store it in internal variable rc.


    VALUE1 is the first value.


    VALUE2 is the second value.

EXAMPLE

    ; Global uninitialized variables
    var     [number] hcf

    ; Get highest common factor
    math_get_hcf (0.5, 1.5)
    mov     hcf (rc)
    dump    hcf

    exit


Ano script                         2016-2023                     Ano script(3)

math_map

Ano script(3)               Ano function reference               Ano script(3)


NAME
    math_map - Map value to range.

SYNOPSIS
    
    math_map (
        (double) VALUE [required],
        (double) CURRENT_MIN [required],
        (double) CURRENT_MAX [required],
        (double) MAPPED_MIN [required],
        (double) MAPPED_MAX [required]
    )
    

DESCRIPTION
    Map value from range of CURRENT_MIN between CURRENT_MAX to range
    of MAPPED_MIN between MAPPED_MAX and store it in internal
    variable rc.


    VALUE is the value to map.


    CURRENT_MIN is the current minimum border for value.


    CURRENT_MAX is the current maximum border for  value.


    MAPPED_MIN is the new minimum border for value.


    MAPPED_MAX is the new maximum border for value.

EXAMPLE

    ; Global uninitialized variables
    var     [number] value

    ; Map value between new min and max
    math_map (1.5, 1.0, 2.0, 10.0, 20.0)
    mov     value (rc)
    dump    value

    exit


Ano script                         2016-2023                     Ano script(3)

Misc functions

misc_exec

Ano script(3)               Ano function reference               Ano script(3)


NAME
    exec - Execute a system command.

SYNOPSIS
    
    exec (
        (string) COMMAND [required],
        (string) OPTION [optional],
        (string) ... [optional]
    )
    

DESCRIPTION
    Execute a system command. exec() works exactly like system
    execvp() function, but does not replace process image with the
    command image to be executed, so this call will return to the
    caller. Command to be executed can have any number of options,
    although there is hard limit somewhere in engine's willingness
    for reading them. See example below.


    COMMAND to be executed.


    OPTION is the command line option to pass to command.

EXAMPLE

    ; Fork one child process
    fork
    mov     pid (rc)

    ; Parent process exists immediately...
    cmp     pid (0)
    jne     "parent"

    ; ...and child process does all the work
    mov     command ("uname")

    sleep ([long] 1, [long] 0)
    exec (command, "-p", "-m", "-r")

    sleep ([long] 1, [long] 0)
    system (command)

    sleep ([long] 1, [long] 0)

: "parent"
    exit


Ano script                         2016-2023                     Ano script(3)

misc_exit

Ano script(3)               Ano function reference               Ano script(3)


NAME
    exit - Terminate running script and request engine to stop.

SYNOPSIS
    
    exit (
        (int8) EXIT_CODE [optional]
    )
    

DESCRIPTION
    Terminate running script and request engine to stop. This is
    mandatory call at the end of every application, otherwise
    application wont quit even when the running script is terminated.

    Terminate running script and request engine to stop. This is
    mandatory call at the end of every application, otherwise
    application wont quit even when the running script is terminated.
    It is possible to pass optional EXIT_CODE code, ranging from 0 to
    255, to remote caller.

EXAMPLE

    See exec.


Ano script                         2016-2023                     Ano script(3)

Thread functions

thread_spawn

Ano script(3)               Ano function reference               Ano script(3)


NAME
    thread_spawn - Spawn a new thread.

SYNOPSIS
    
    thread_spawn (
        (string) THREAD_NAME [required],
        (string) THREAD_FUNCTION [required]
    )
    

DESCRIPTION
    Spawn a new thread to run concurrently with main application.
    Thread runs until it calls 'end', when thread is destroyed. If
    thread is needed again after that, is must be respawned. Care
    should be taken if thread modifies global variables as there
    is no thread-safeness in internal data structures.


    THREAD_NAME is name of the thread.


    THREAD_FUNCTION is executing function name of the thread.

EXAMPLE

    ; Spawn thread
    thread_spawn ("My thread", "my_thread")

    exit

thread my_thread {
    mov     _msg ("Hello from thread!")
    dump    _msg
}


Ano script                         2016-2023                     Ano script(3)

Widget functions

widget_change_set

Ano script(3)               Ano function reference               Ano script(3)


NAME
    widget_change_set - Change active widget set.

SYNOPSIS
    
    widget_change_set (
        (handle) WINDOW_HANDLE [required],
        (uint)   WIDGET_SET [required]
    )
    

DESCRIPTION
    Change active widget set to WIDGET_SET.  Widget set is defined
    in widget definition file, by using set keyword.  Widgets having
    set 0 are members of every set, in other words, their appearance
    cannot be changed by this function. It is required to call
    widget_refresh() afterwards to update changes to window.

EXAMPLE

XXX


Ano script                         2016-2023                     Ano script(3)

widget_indicator_set

Ano script(3)               Ano function reference               Ano script(3)


NAME
    widget_indicator_set - Set widget indicator mode and outlook.

SYNOPSIS
    
    widget_indicator_set (
        (handle) WINDOW_HANDLE [required],
        (string) WIDGET_NAME [required],
        (string) FONT_FILE [optional],
        (string) FONT_CHARSET [optional],
        (uint)   FONT_SIZE [required],
        (uint)   FONT_RESOLUTION [optional],
        (color)  INDICATOR_COLOR [required],
        (uint)   INDICATOR_MODE [required],
        (int)    INDICATOR_VERTICAL_OFFSET [required]
    )
    

DESCRIPTION
    Indicator displays the current value of the widget.


    Indicator is placed in opposite of widget title, so if title
    is above the widget, indicator is below.


    WINDOW_HANDLE is the handle of the window where the widget is
    and must be returned by window_open().


    WIDGET_NAME


    FONT_FILE


    FONT_CHARSET


    FONT_SIZE


    FONT_RESOLUTION


    INDICATOR_COLOR


    INDICATOR_MODE can be either 0 to disable indicator (this is
    the default when widget is created), 1 to display indicator ?,
    2 to display indicator only when mouse is over the widget.


    INDICATOR_VERTICAL_OFFSET is the offset in pixels to move
    indicator up or down from its default position.

EXAMPLE


Ano script                         2016-2023                     Ano script(3)

Window functions

window_close

Ano script(3)               Ano function reference               Ano script(3)


NAME
    window_close - Close opened window.

SYNOPSIS
    
    window_close (
        (handle) WINDOW_HANDLE [required]
    )
    

DESCRIPTION
    Close opened window. WINDOW_HANDLE must be valid handle returned
    by window_open(). After call completes, window is gone for good
    and should not be referenced again.

EXAMPLE

    See window_open.


Ano script                         2016-2023                     Ano script(3)

window_icon

Ano script(3)               Ano function reference               Ano script(3)


NAME
    window_icon - Set window icon.

SYNOPSIS
    
    window_icon (
        (handle) WINDOW_HANDLE [required],
        (string) FILE_NAME [required]
    )
    

DESCRIPTION
    Add a small icon to window, usually displayed in titlebar's left
    corner, on taskbar and possibly some other places. Supported file
    formats for FILE_NAME are BMP and TGA.

EXAMPLE

    ; Variable type is handle
    var     [handle] window_handle

    ; Initialize windowing system
    window_init

    ; Open window that refresh 60 times per second and end main process,
    ; leaving further actions to callback functions
    window_open ("Window Title", NULL, [handle] @0, \
                [uint] 0, [uint] 0, [uint] 1, [int] -1, [int] -1, \
                [uint] 800, [uint] 600, NULL, NULL, NULL, NULL, NULL, NULL, \
                NULL, NULL, "cb_destroy", NULL, NULL, NULL, "cb_open")
    end

callback cb_open (hnd) {
    ; Store window handle for later use
    mov     window_handle (hnd)

    ; Set window icon
    window_icon (window_handle, "my_icon.tga")

    ; Map window to screen
    window_map (window_handle)
}

callback cb_destroy {
    ; When window close button is pressed by user, close window and terminate
    ; application
    window_unmap (window_handle)
    window_close (window_handle)

    exit
}


Ano script                         2016-2023                     Ano script(3)

window_init

Ano script(3)               Ano function reference               Ano script(3)


NAME
    window_init - Initialize windowing system.

SYNOPSIS
    
    window_init
    

DESCRIPTION
    Initialize windowing system. This call must be called before
    any other windowing functions, like window_open().  Initialization
    must be done only once in application lifetime.

EXAMPLE

    See window_open.


Ano script                         2016-2023                     Ano script(3)

window_map

Ano script(3)               Ano function reference               Ano script(3)


NAME
    window_map - Map unmapped window.

SYNOPSIS
    
    window_map (
        (handle) WINDOW_HANDLE [required]
    )
    

DESCRIPTION
    Map (show) unmapped (hidden) window. WINDOW_HANDLE must be valid
    handle returned by window_open().

EXAMPLE

    See window_open.


Ano script                         2016-2023                     Ano script(3)

window_open

Ano script(3)               Ano function reference               Ano script(3)


NAME
    window_open - Open new window.

SYNOPSIS
    
    window_open (
        (string) TITLE_NAME [optional],
        (string) TITLE_CHARSET [optional],
        (handle) PARENT_HANDLE [required],
        (uint)   WIDGET_STACK_ID [required],
        (uint)   WIDGET_SET [required],
        (uint)   WINDOW_REFRESH_DIVIDER [required],
        (int)    POSITION_X [required],
        (int)    POSITION_Y [required],
        (uint)   SIZE_WIDTH [required],
        (uint)   SIZE_HEIGHT [required],
        (string) CB_MAIN_LOOP [optional],
        (string) CB_EXPOSE [optional],
        (string) CB_KEY_PRESS [optional],
        (string) CB_KEY_RELEASE [optional],
        (string) CB_BUTTON_PRESS [optional],
        (string) CB_BUTTON_RELEASE [optional],
        (string) CB_CLIENT_MESSAGE [optional],
        (string) CB_CONFIGURE_NOTIFY [optional],
        (string) CB_DESTROY_NOTIFY [optional],
        (string) CB_MOTION_NOTIFY [optional],
        (string) CB_MAP_NOTIFY [optional],
        (string) CB_UNMAP_NOTIFY [optional],
        (string) CB_OPEN_NOTIFY [optional]
    )
    

DESCRIPTION
    Open new window and initialize callback functions. If opening
    the window succeeds, CB_OPEN_NOTIFY is called with window handle
    as a parameter.  Application must store this handle for later
    use. See example below.


    If PARENT_HANDLE is not zero, window is created as subwindow
    to PARENT_HANDLE.


    If WIDGET_STACK_ID is not zero, window is populated with widgets
    defined by that ID (= window ID in widget definitions). When
    using widgets in window, using zero as WINDOW_REFRESH_DIVIDER
    is recommended.


    If WIDGET_SET is not zero, only widget belonging to that set
    are initially populated to window. Widgets having set 0 belongs
    to all sets and are drawn to window no matter what value
    WIDGET_SET has.


    If WINDOW_REFRESH_DIVIDER is zero, window is considered as
    passive, and is refreshed only when there is something to
    refresh.


    If WINDOW_REFRESH_DIVIDER greater than zero, window is considered
    as active, and is refreshed continuously <screen refresh
    rate> / WINDOW_REFRESH_DIVIDER times per second. Values
    higher than current screen refresh rate will be clamped down
    equal to current screen refresh rate. According to formula
    above, value of 1 makes screen refresh realtime.


    By setting window refresh divider greater than zero affects to
    other active windows as well, in other words, this parameter
    is global, and last active window opened sets the global refresh
    rate for all other active windows.


    If either WINDOW_POSITION_[X,Y] is -1, window is centered on
    screen or parent window in that, or both, axis.


    If CB_MAIN_LOOP is not empty, main loop callback function is
    installed and called at same frequency as window refresh rate.
    If only one passive window exists, its main loop callback will
    be called 60 times per second until window is closed or active
    window sets new refresh rate (see WINDOW_REFRESH_DIVIDER above).


    All other callback functions except CB_MAIN_LOOP and CB_OPEN_NOTIFY
    follows more or less standard Xlib style how they are called.

EXAMPLE

    ; Variable type is handle
    var     [handle] window_handle

    ; Initialize windowing system
    window_init

    ; Open window that refresh 60 times per second and end main process,
    ; leaving further actions to callback functions
    window_open ("Window Title", NULL, [handle] @0, \
                [uint] 0, [uint] 0, [uint] 1, [int] -1, [int] -1, \
                [uint] 800, [uint] 600, NULL, NULL, NULL, NULL, NULL, NULL, \
                NULL, NULL, "cb_destroy", NULL, NULL, NULL, "cb_open")
    end

callback cb_open (hnd) {
    ; Store window handle for later use
    mov     window_handle (hnd)

    ; Map window to screen
    window_map (window_handle)
}

callback cb_destroy {
    ; When window close button is pressed by user, close window and terminate
    ; application
    window_unmap (window_handle)
    window_close (window_handle)

    exit
}


Ano script                         2016-2023                     Ano script(3)

window_refresh

Ano script(3)               Ano function reference               Ano script(3)


NAME
    window_refresh - Refresh window area.

SYNOPSIS
    
    window_refresh (
        (handle) WINDOW_HANDLE [required],
        (int)    AREA_X [required],
        (int)    AREA_Y [required],
        (uint)   AREA_WIDTH [required],
        (uint)   AREA_HEIGHT [required]
    )
    

DESCRIPTION
    Refresh (redraw) window area. WINDOW_HANDLE must be valid handle
    returned by window_open(). This function returns immediately
    and window refresh actually takes place when drawing request
    pipeline is flushed somewhere in near future.


    If AREA_WIDTH or AREA_HEIGHT is zero, it will be replaced with
    window width or height, respectively.

EXAMPLE

    ; ...open window here first, see window_open...

    ; Refresh whole window
    window_refresh (window_handle, [int] 0, [int] 0, [uint] 0, [uint] 0)

    end


Ano script                         2016-2023                     Ano script(3)

window_set_attrs

Ano script(3)               Ano function reference               Ano script(3)


NAME
    window_set_attrs - Set window attributes.

SYNOPSIS
    
    window_set_attrs (
        (handle) WINDOW_HANDLE [required],
        (uint)   ATTRIBUTE [required],
        (double) ATTRIBUTE_VALUE [required]
    )
    

DESCRIPTION
    WINDOW_HANDLE must be valid handle returned by window_open().
    Set the window attribute value in ATTRIBUTE parameter:


    1 window is above all other windows, set ATTRIBUTE_VALUE to
    zero.


    2 window is below all other windows, set ATTRIBUTE_VALUE to
    zero.


    3 window has border, set ATTRIBUTE_VALUE to zero if not, or
    greater than zero if yes.


    4 put window on certain desktop, set desktop number in
    ATTRIBUTE_VALUE.


    5 window x position, set position in pixels in ATTRIBUTE_VALUE.


    6 window y position, set position in pixels in ATTRIBUTE_VALUE.


    7 skip pager, set ATTRIBUTE_VALUE to zero.


    8 skip taskbar, set ATTRIBUTE_VALUE to zero.


    9 set window sticky, set ATTRIBUTE_VALUE to zero.


    10 window transparency, set transparency in ATTRIBUTE_VALUE,
    from 0.0 to 1.0. It depends on windowing system and window
    manager whether setting transparency works or not.

EXAMPLE

    ; ...open window here first, see window_open...

    ; Set window to above all others, 1 = keep above
    window_set_attrs (window_handle, 1, 0)

    ; Set window border off, 3 = has border, 0 = not
    window_set_attrs (window_handle, 3, 0)

    ; Map window
    window_map (window_handle)

    end


Ano script                         2016-2023                     Ano script(3)

window_unmap

Ano script(3)               Ano function reference               Ano script(3)


NAME
    window_unmap - Unmap mapped window.

SYNOPSIS
    
    window_unmap (
        (handle) WINDOW_HANDLE [required]
    )
    

DESCRIPTION
    Unmap (hide) mapped (visible) window. WINDOW_HANDLE must be
    valid handle returned by window_open().

EXAMPLE

    See window_open.


Ano script                         2016-2023                     Ano script(3)

Copyright © 2023, Jani Salonen <salojan at goto10 piste co>. Piste is finnish word and means dot. All rights reserved.