Skip to content

Commit 01630cb

Browse files
committed
Modified display api
1 parent 9cef5ae commit 01630cb

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/scripting/api/Display.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,21 @@ var $ = new function(){
304304
this.beginFill = function(color, alpha){
305305
updateObject("beginFill", [toRGB(color), (alpha ? alpha : 1)]);
306306
};
307+
this.drawPath = function(commands, params){
308+
for(var i = 0; i < commands.length; i++){
309+
switch(commands[i]){
310+
case 1:{
311+
this.moveTo(params.shift(), params.shift());break;
312+
}
313+
case 2:{
314+
this.lineTo(params.shift(), params.shift());break;
315+
}
316+
case 3:{
317+
this.curveTo(params.shift(), params.shift(),params.shift(), params.shift());break;
318+
}
319+
}
320+
}
321+
};
307322
this.beginGradientFill = function(){
308323
__trace("Gradient not supported yet", 'warn');
309324
};

0 commit comments

Comments
 (0)