PPML

Pixel Place Map Loader

As of 22/04/2022. See the latest version.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/443803/1042800/PPML.js

Autor
Exnonull
Verzija
1.2
Napravljeno
22/04/2022
Ažurirano
22/04/2022
Size
4,7 КБ
Licenca
MIT

to make this lib working require CWSS and WorkerTimer



Variable: PPML || window.PPML

PPML.ws // WebSocket
PPML.safeEmit(x,y,pixel) // undefined
PPML.emit(x,y,pixel) // undefined / false / true
PPML.map
{
    pixels, // Uint8[]
    colors, // Uint32[]
    width, height, // number
    find(pixel) // index of pixels
    get(x,y) // pixel
    set(x,y,pixel) // undefined
}

PPML.setHook({
    priority: 0,
    init(map) {
        // ...
    }
});