belugalearning / tools-basis

0 stars 0 forks source link

Compiling Resources:

You'll need to install optipng first. brew install optipng if you have http://brew.sh/ installed. This script requires base64 --version 1.5. You may need to install it using homebrew too.

Add/ remove any resources

Run ./compile_resources.sh to update the references in resource.json

Tool API Req:

Controls

All configurable controls should be registered with the ToolLayer's registerControl(id, control) method.

References to tools can then be fetched by using getControl(id) or getControls(pattern).

State

All tools should respond to setQuestion(question) and getState().

Tools

Creating a new Tool

Sorting

Expected behaviour

Content service will send:

Tool will be able to:

Stacked sprite usage

Stacked sprite creates a node with sprites stacked on top of each other from an object in the following format:

{
    layers:[
        {
            filename (optional): string, 
            color (optional):{r: int, g: int, b: int, a},
                height (when color): int, 
                width (when color): int, 
            priority (optional): int, 
            position (optional):{x: int, y: int}
        },
        ...
    ],
}

The filenames are those in resource.json