Where are the libraries?

I'm working on a Snap! distro. So I've been "snooping" round the files. I have 2 questions:
(This is for the offline version of Snap!)

  1. Where are the images for the blocks?

  2. How do I access the costume library and the example projects in the editor (I found them in the files, but how do i access them thorugh the Snap! editor?)

There isn't a collection of block images, because blocks can have arbitrary inputs inside them, so they have to be drawn dynamically. This is done in blocks.js, e.g. in ReporterBlockMorph.prototype.drawNew()

So where are the costume libraries and example projects in the editor

Hi,

Snap! media (costumes and sounds), examples and libraries are well located in our repo, and I'm sure you have found their folders: Backgrounds, Costumes ...

The problem is that you are running Snap! over file:// protocol and then, the behaviour changes: Snap! runs ok, but without direct access to local files. And all this is according to browsers spec (see about "file://" protocol, CORS....)

If you want to run a full offline Snap! you can fire it with a local web server (and then, run Snap! over http://localhost...) or you can made your own packed-app (with nodejs or others).

For example, Snap4Arduino is a full Snap! desktop edition, and its app is made with nwjs.

Joan

The code that loads a library starts at gui.js line 3281.