paper.js/src/svg/ImportSVG.js

55 lines
1,022 B
JavaScript
Raw Normal View History

/**
* Imports svg into items with groups
* Stetson Alpha - Paper.js
2012-09-15 19:58:44 -04:00
*
*/
var ImportSVG = function()
{
//initialize
function initialize()
{
2012-09-15 19:58:44 -04:00
};
2012-09-15 19:58:44 -04:00
/**
2012-09-15 19:58:44 -04:00
*
* Takes the svg dom obj and parses the data
* to create a layer with groups (if needed) with
* items inside. Should support nested groups.
2012-09-15 19:58:44 -04:00
*
* takes in a svg object (xml dom)
2012-09-15 19:58:44 -04:00
* returns Paper.js Layer
*/
this.importSVG = function(svg)
{
return layer;
};
2012-09-15 19:58:44 -04:00
/**
* Creates a Paper.js Group by parsing
* a specific svg g node
2012-09-15 19:58:44 -04:00
*
* takes in a svg object (xml dom)
* returns Paper.js Group
*/
function importGroup(svg)
{
return group;
};
2012-09-15 19:58:44 -04:00
/**
* Creates a Paper.js Path by parsing
* a specific svg node (rect, path, circle, polygon, etc)
* and creating the right path object based on the svg type.
2012-09-15 19:58:44 -04:00
*
* takes in a svg object (xml dom)
* returns Paper.js Group
*/
function importPath(svg)
{
return path;
};
2012-09-15 19:58:44 -04:00
initialize(); // calls the init function after class is loaded
};