An encapsulation of code generation for a graphical stroke.
| StrokeCodeGenerator | An encapsulation of code generation for a graphical stroke. |
| Code generation | |
| generateCode | Generates script code for methods creating a stroke sprite, shape or a path. |
| generateGraphicsCode | Generate AS3 code for a method creating a sprite or a shape. |
| generateActionCode | Generate AS3 code for a graphics drawing action. |
| generatePathCode | Generate AS3 code for a method creating a value or motion path. |
| Static helpers | |
| approximateEqual | Chekcs if two values are almost the same. |
public static function generateCode( stroke: Stroke, title: String, indent: String, codeStyle: Object ):String
Generates script code for methods creating a stroke sprite, shape or a path.
| stroke | graphics stroke object |
| title | version decorated identification of the generating application |
| indent | string with spaces to indent each line of code |
| codeStyle | dynamic object with properties describing the desired code style |
a script snippet
private static function generateGraphicsCode( stroke: Stroke, title: String, shapeName: String, tempName: String, indent: String, appendCode: String, scaleXFunc: Function, scaleYFunc: Function ):String
Generate AS3 code for a method creating a sprite or a shape.
| stroke | graphics stroke object |
| title | version decorated identification of the generating application |
| shapeName | asset name of the asset being generated |
| tempName | name of the temporary variable used in the method |
| indent | string with spaces to indent each line of code |
| appendCode | code snippet string inserted after the graphics code |
| scaleXFunc | a function for scaling X values |
| scaleYFunc | a function for scaling Y values |
An AS3 code snippet
private static function generateActionCode( item: StrokeItem, itemPrev: StrokeItem, scaleXFunc: Function, scaleYFunc: Function ):String
Generate AS3 code for a graphics drawing action.
| item | the StrokeItem to generate code for |
| itemPrev | the StrokeItem before the current item, can be null |
| scaleXFunc | a function for scaling X values |
| scaleYFunc | a function for scaling Y values |
An AS3 method code snippet
private static function generatePathCode( stroke: Stroke, title: String, shapeName: String, tempName: String, indent: String ):String
Generate AS3 code for a method creating a value or motion path.
| stroke | graphics stroke object |
| title | version decorated identification of the generating application |
| shapeName | asset name of the path being generated |
| tempName | name of the temporary variable used in the method |
| indent | string with spaces to indent each line of code |
An AS3 code snippet
Generates script code for methods creating a stroke sprite, shape or a path.
public static function generateCode( stroke: Stroke, title: String, indent: String, codeStyle: Object ):String
Generate AS3 code for a method creating a sprite or a shape.
private static function generateGraphicsCode( stroke: Stroke, title: String, shapeName: String, tempName: String, indent: String, appendCode: String, scaleXFunc: Function, scaleYFunc: Function ):String
Generate AS3 code for a graphics drawing action.
private static function generateActionCode( item: StrokeItem, itemPrev: StrokeItem, scaleXFunc: Function, scaleYFunc: Function ):String
Generate AS3 code for a method creating a value or motion path.
private static function generatePathCode( stroke: Stroke, title: String, shapeName: String, tempName: String, indent: String ):String
Chekcs if two values are almost the same.
private static function approximateEqual( val1: Number, val2: Number ):Boolean