ZIM js JavaScript Framework

Canvas Components, Controls and more!

ZIM 2.5.2 Adds Wrapper to CreateJS PreloadJS Functionality for loading Image and Sound on HTML 5 Canvas with JavaScript

CreateJS (PreloadJS) has a LoadQueue class with a loadManifest() method – the manifest is an array of objects with src and id properties.    Once loaded, you create a new createjs.Bitmap(loadQueue.getResult()).  For sound you install a plugin with installPlugin(createjs.Sound).  This procedure works well, but  has always been a touch scary looking for just loading pictures and sound.


So ZIM 2.5.2 has wrapped PreloadJS in the zim Frame() class.  You call a loadAssets() method and pass it an array of file names and optional path.  When the loading is complete use the asset() method and the file name to get a reference to the asset.  This will be a Bitmap for images or use the asset().play() to play a sound.


You can see the ZIM Bits PRELOAD example and here is the OLD PRELOAD for reference. There are also the Templates for preloading available on the http://zimjs.com site.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


This entry was posted on March 26, 2016 by in javascript and tagged , , , , , , , , , , .


%d bloggers like this: