Navigation for the ZIM JavaScript Canvas Framework

HOME News About Examples Learn Code Docs Devs

CRYSTAL for One-line Script Call!



ZIM NEWS for JavaScript HTML Canvas Coding
ZIM CRYSTAL

ZIM CRYSTAL has been DEPRECATED in favour of ES6 Modules.

ZIM is powered by CreateJS so ZIM apps (Zapps) have traditionally needed at least TWO external script calls. As of ZIM NFT, we simplify this with ZIM Crystal. A Crystal is a single script that calls a set of scripts. This means that there is only one script call needed (paths not shown):

<script src=zim.js></script>

The zim.js Crystal file calls CreateJS and ZIM like this:

document.write("<"+"script src=createjs.js></"+"script>");
document.write("<"+"script src=zim_min.js></"+"script>");

There are a variety of Crystal files. See the ZIM CDN for links to the Crystal scripts.

Note: you can also still use individual scripts from the CDN like always.

Note: as of ZIM NFT, the actual ZIM minified file is now called zim_min.js.

Note: ignore Chrome console warnings about something that might happen on G2 in the future.


See information on using Script Tags.

Also available are ES6 Modules that match the Crystals.

ZIM CRYSTALS

  • zim.js - CreateJS and ZIM
  • zim_game.js - CreateJS, ZIM and ZIM Game Module
  • zim_physics.js - CreateJS, ZIM, Box2D, ZIM Physics and Game Modules
  • zim_socket.js - CreateJS, ZIM, SocketIO, ZIM Socket Module and Server URLs
  • zim_three.js - CreateJS, ZIM, Three.js, OrbitControls and ZIM Three Module
  • zim_cam.js - CreateJS, ZIM, Cam Module
  • zim_pizzazz.js - CreateJS, ZIM, Pizzazz 01, 02, 03
  • zim_distill.js - CreateJS and distilled code placeholder
  • zim_test.js - CreateJS and ZIM Docs


UPDATES

Each sub version of ZIM will have a set of Crystals that call the current libraries at the time. If one of the libraries in a Crystal has its version updated then a new version of that Crystal will be created and listed in the CDN in a subfolder starting at 01. For example, if the game module changed version, then the original Crystals would still be there and additional game and physics Crystals would be added:

// note the examples use NFT 00
// ZIM may be at a higher version
cdn/nft/00/zim_game.js
cdn/nft/00/zim_physics.js
cdn/nft/00/01/zim_game.js
cdn/nft/00/01/zim_physics.js

If later, the physics module is updated, then a new physics Crystal would be added:

cdn/nft/00/zim_game.js
cdn/nft/00/zim_physics.js
cdn/nft/00/01/zim_game.js
cdn/nft/00/01/zim_physics.js
cdn/nft/00/02/zim_physics.js

When a new subversion of ZIM is launched, a new set of Crystals will also be launched.

cdn/nft/01/zim.js
cdn/nft/01/zim_game.js
cdn/nft/01/zim_physics.js
etc.

The CDN will feature the latest crystals and just use one of those to make your app. You most likely will not need to update your app if Crystals change. BTW, all this is automated.