Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

README.md

XPMJS

Very little library to use pseudo-XPM images in javascript.

Usage example:

<div id="cvs"></div>

var xpmImage = XPM.create(
    '24 24 2 1',
    '  c #AAA',
    'x c #000',
    '      xxxxxxxxxxxx      ',
    '     xxxxxxxxxxxxxx     ',
    '    xxxxxxxxxxxxxxxx    ',
    '   xxxxxxxxxxxxxxxxxx   ',
    '  xxxxxxxxxxxxxxxxxxxx  ',
    ' xxxxxxxxxxxxxxxxxxxxxx ',
    '  xxxxxxxxxxxxxxxxxxxx  ',
    '   xxxxxxxxxxxxxxxxxx   ',
    '    xxxxxxxxxxxxxxxx    ',
    '     xxxxxxxxxxxxxx     ',
    '      xxxxxxxxxxxx      ',
    '       xxxxxxxxxx       ',
    '        xxxxxxxx        ',
    '         xxxxxx         ',
    '          xxxx          ',
    '           xx           ',
    '          xxxx          ',
    '         xxxxxx         ',
    '        xxxxxxxx        ',
    '       xxxxxxxxxx       ',
    '      xxxxxxxxxxxx      ',
    '     xxxxxxxxxxxxxx     ',
    '    xxxxxxxxxxxxxxxx    ',
    '   xxxxxxxxxxxxxxxxxx'
)
document.getElementById('cvs').appendChild(xpmImage)

Will print out: this image

It is not faster than .drawImage, check it out by yourself there. It may catch up with it after caching for multiple times, but it will always be slower.

However, it may have some use, as you can see here. Mainly, bandwidth saving, reuse of the same icon with different colors and quick editing of those icons.

About

No description, website, or topics provided.

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.