/*
 * JamMo GUI - user interface application
 * 
 * JamMo GUI is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * JamMo GUI is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Pictures used in this application are not ment for actual usage.
 * They are provided only for demo purposes. Pictures in 'objects' and
 * 'stages' directories are not under GNU General Public License.
 * 
 * Pictures in 'objects' directory have been copied from:
 * clutter-project.org
 * 
 * Pictures in 'stages' directory have been copied from:
 * www.wallpaperez.info
 */


HOW TO USE STAGES
Directory-structure:
themes/stage1
themes/stage1/background.png
themes/stage1/object1.png
themes/stage1/object2.png
themes/stage1/object3.png
themes/stage1/object4.png
themes/stage1/loop1.wav
themes/stage1/loop2.wav
themes/stage1/loop3.wav
themes/stage1/loop4.wav


 These objects must also be specified in config.json file, more help about this is found bellow.


HOW TO USE OBJECTS AND BEHAVIOURS (CONFIG.JSON)

Config-file config.json uses ClutterScript, which can be modified easily by user. More about ClutterScript:
http://www.clutter-project.org/docs/clutter/0.8/ClutterScript.html


Behaviours:

We have made six different behaviours to demonstrate some object effects. Behaviours are named (id) to demonstrate the object movement. For example “ rotate-behaviour” means that object simply rotates around some axis.

Example:
Users can change behaviour options freely, for example by changing speed, rotation angle or other inputs. Users can also add more behaviours and set objects to use them according to ClutterScript.

{
  "id" : "rotate-behaviour",
  "type" : "ClutterBehaviourRotate",
  "angle-start" : 0.0,
  "angle-end" : 20.0,
  "axis" : "z-axis",
  "center-y" : 50,
  "alpha" : {
    "timeline" : { "duration" : 6000, "fps" : 60, "loop" : true },
    "function" : "sine"
  }
}


Objects:

We have made each example stage 6 different example objects. Objects are named with numbers: the first number is the stage number where the object should appear and the second number is the object number in the stage. For example, the third object on the second stage would be named “object-2-3”. Each existing object needs to have an image file in config/objects/stage[number] directory. For example, if the first stage has 5 objects, there has to be 5 images in config/objects/stage1 directory. These objects should be named in number order starting from number one. These filename numbers will be equal to object numbers in stages. For example, object2.png in config/objects/stage3 will be the second object on the third stage (named object-3-2 in the config file).

Examples:
Objects can be added, removed or edited freely according to ClutterScript. Each object can be react to different signals and have an behaviour according to the signal. For example, the example bellow makes the object to use scale-behaviour when object is shown. More help and examples can be found from the reference to ClutterScript in the beginning of this file.

{
  "id" : "object-1-1",
  "type" : "ClutterTexture",
  "filename": "objects/stage1/object1.png",
  "x": 500,
  "y": 50,
  "behaviours" : [ "scale-behaviour"],
  "signals": [
    {
      "name": "show",
      "handler": "stage_start_behaviour",
      "object":  "scale-behaviour",   
    }
  ]
}

