2012-03-07 13:45:48 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
// Shape
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
/**
|
|
|
|
* Shape constructor. Shapes are used to objectify drawing bits of a KineticJS
|
|
|
|
* application
|
|
|
|
* @constructor
|
|
|
|
* @augments Kinetic.Node
|
|
|
|
* @param {Object} config
|
2012-05-20 12:14:04 +08:00
|
|
|
* @config {String|Object} [fill] can be a string color, a linear gradient object, a radial
|
2012-05-14 01:46:49 +08:00
|
|
|
* gradient object, or a pattern object.
|
2012-03-31 14:57:10 +08:00
|
|
|
* @config {String} [stroke] stroke color
|
|
|
|
* @config {Number} [strokeWidth] stroke width
|
2012-05-14 01:46:49 +08:00
|
|
|
* @config {String} [lineJoin] line join can be "miter", "round", or "bevel". The default
|
2012-03-31 14:57:10 +08:00
|
|
|
* is "miter"
|
2012-05-20 12:14:04 +08:00
|
|
|
* @config {Object} [shadow] shadow object
|
2012-04-01 16:08:33 +08:00
|
|
|
* @config {String} [detectionType] shape detection type. Can be "path" or "pixel".
|
|
|
|
* The default is "path" because it performs better
|
2012-03-07 13:45:48 +08:00
|
|
|
*/
|
|
|
|
Kinetic.Shape = function(config) {
|
2012-04-29 03:55:18 +08:00
|
|
|
this.setDefaultAttrs({
|
|
|
|
fill: undefined,
|
|
|
|
stroke: undefined,
|
|
|
|
strokeWidth: undefined,
|
|
|
|
lineJoin: undefined,
|
2012-05-20 13:11:33 +08:00
|
|
|
detectionType: 'path',
|
|
|
|
shadow: {
|
2012-05-21 01:47:28 +08:00
|
|
|
blur: 10,
|
|
|
|
alpha: 1,
|
2012-05-21 07:42:37 +08:00
|
|
|
offset: {
|
2012-05-27 01:57:56 +08:00
|
|
|
x: 0,
|
|
|
|
y: 0
|
2012-05-21 07:42:37 +08:00
|
|
|
}
|
2012-05-20 13:11:33 +08:00
|
|
|
}
|
2012-04-29 03:55:18 +08:00
|
|
|
});
|
2012-04-06 14:48:58 +08:00
|
|
|
|
2012-04-02 10:38:30 +08:00
|
|
|
this.data = [];
|
2012-04-08 05:39:31 +08:00
|
|
|
this.nodeType = 'Shape';
|
2012-05-27 11:34:36 +08:00
|
|
|
this.appliedShadow = false;
|
2012-03-07 13:45:48 +08:00
|
|
|
|
|
|
|
// call super constructor
|
|
|
|
Kinetic.Node.apply(this, [config]);
|
|
|
|
};
|
|
|
|
/*
|
|
|
|
* Shape methods
|
|
|
|
*/
|
|
|
|
Kinetic.Shape.prototype = {
|
|
|
|
/**
|
2012-03-14 12:16:25 +08:00
|
|
|
* get layer context where the shape is being drawn. When
|
|
|
|
* the shape is being rendered, .getContext() returns the context of the
|
|
|
|
* user created layer that contains the shape. When the event detection
|
|
|
|
* engine is determining whether or not an event has occured on that shape,
|
2012-04-01 15:31:02 +08:00
|
|
|
* .getContext() returns the context of the invisible path layer.
|
2012-03-07 13:45:48 +08:00
|
|
|
*/
|
|
|
|
getContext: function() {
|
2012-05-13 06:32:27 +08:00
|
|
|
if(this.tempLayer === undefined) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return this.tempLayer.getContext();
|
|
|
|
}
|
2012-03-07 13:45:48 +08:00
|
|
|
},
|
|
|
|
/**
|
|
|
|
* get shape temp layer canvas
|
|
|
|
*/
|
|
|
|
getCanvas: function() {
|
|
|
|
return this.tempLayer.getCanvas();
|
|
|
|
},
|
2012-04-29 12:12:01 +08:00
|
|
|
/**
|
2012-05-27 11:34:36 +08:00
|
|
|
* helper method to stroke the shape and apply
|
|
|
|
* shadows if needed
|
2012-04-29 12:12:01 +08:00
|
|
|
*/
|
|
|
|
stroke: function() {
|
2012-05-27 11:34:36 +08:00
|
|
|
var appliedShadow = false;
|
2012-04-29 12:12:01 +08:00
|
|
|
var context = this.getContext();
|
2012-05-27 11:34:36 +08:00
|
|
|
context.save();
|
2012-04-29 12:12:01 +08:00
|
|
|
|
|
|
|
if(!!this.attrs.stroke || !!this.attrs.strokeWidth) {
|
2012-05-27 11:34:36 +08:00
|
|
|
if(!this.appliedShadow) {
|
|
|
|
appliedShadow = this._applyShadow();
|
|
|
|
}
|
|
|
|
|
2012-04-29 12:12:01 +08:00
|
|
|
var stroke = !!this.attrs.stroke ? this.attrs.stroke : 'black';
|
|
|
|
var strokeWidth = !!this.attrs.strokeWidth ? this.attrs.strokeWidth : 2;
|
|
|
|
|
|
|
|
context.lineWidth = strokeWidth;
|
|
|
|
context.strokeStyle = stroke;
|
|
|
|
context.stroke();
|
|
|
|
}
|
2012-05-27 11:34:36 +08:00
|
|
|
|
|
|
|
context.restore();
|
|
|
|
|
|
|
|
if(appliedShadow) {
|
2012-05-10 10:15:49 +08:00
|
|
|
this.stroke();
|
|
|
|
}
|
2012-05-09 14:06:13 +08:00
|
|
|
},
|
2012-03-07 13:45:48 +08:00
|
|
|
/**
|
2012-05-14 01:46:49 +08:00
|
|
|
* helper method to fill the shape with a color, linear gradient,
|
2012-05-27 11:34:36 +08:00
|
|
|
* radial gradient, or pattern, and also apply shadows if needed
|
|
|
|
* */
|
2012-05-09 14:06:13 +08:00
|
|
|
fill: function() {
|
2012-05-27 11:34:36 +08:00
|
|
|
var appliedShadow = false;
|
2012-03-07 13:45:48 +08:00
|
|
|
var context = this.getContext();
|
2012-05-27 11:34:36 +08:00
|
|
|
context.save();
|
|
|
|
|
2012-05-04 05:20:50 +08:00
|
|
|
var fill = this.attrs.fill;
|
2012-06-14 17:19:51 +08:00
|
|
|
|
2012-05-04 05:20:50 +08:00
|
|
|
if(!!fill) {
|
2012-05-27 11:34:36 +08:00
|
|
|
if(!this.appliedShadow) {
|
|
|
|
appliedShadow = this._applyShadow();
|
|
|
|
}
|
|
|
|
|
2012-05-13 09:18:06 +08:00
|
|
|
var s = fill.start;
|
|
|
|
var e = fill.end;
|
|
|
|
var f = null;
|
|
|
|
|
2012-05-04 05:20:50 +08:00
|
|
|
// color fill
|
|
|
|
if( typeof fill == 'string') {
|
|
|
|
f = this.attrs.fill;
|
2012-05-14 01:27:40 +08:00
|
|
|
context.fillStyle = f;
|
|
|
|
context.fill();
|
2012-05-04 05:20:50 +08:00
|
|
|
}
|
2012-05-21 02:12:07 +08:00
|
|
|
// pattern
|
2012-05-13 09:18:06 +08:00
|
|
|
else if(fill.image !== undefined) {
|
|
|
|
var repeat = fill.repeat === undefined ? 'repeat' : fill.repeat;
|
|
|
|
f = context.createPattern(fill.image, repeat);
|
2012-05-14 01:27:40 +08:00
|
|
|
|
2012-05-14 01:46:49 +08:00
|
|
|
context.save();
|
2012-05-27 01:57:56 +08:00
|
|
|
|
2012-06-18 08:18:49 +08:00
|
|
|
if(fill.scale !== undefined) {
|
|
|
|
context.scale(fill.scale.x, fill.scale.y);
|
|
|
|
}
|
2012-05-27 01:57:56 +08:00
|
|
|
if(fill.offset !== undefined) {
|
|
|
|
context.translate(fill.offset.x, fill.offset.y);
|
|
|
|
}
|
|
|
|
|
2012-05-14 01:27:40 +08:00
|
|
|
context.fillStyle = f;
|
|
|
|
context.fill();
|
|
|
|
context.restore();
|
2012-05-13 09:18:06 +08:00
|
|
|
}
|
2012-05-21 02:12:07 +08:00
|
|
|
// linear gradient
|
|
|
|
else if(s.radius === undefined && e.radius === undefined) {
|
2012-05-13 09:18:06 +08:00
|
|
|
var context = this.getContext();
|
|
|
|
var grd = context.createLinearGradient(s.x, s.y, e.x, e.y);
|
2012-05-21 02:12:07 +08:00
|
|
|
var colorStops = fill.colorStops;
|
|
|
|
|
|
|
|
// build color stops
|
|
|
|
for(var n = 0; n < colorStops.length; n += 2) {
|
|
|
|
grd.addColorStop(colorStops[n], colorStops[n + 1]);
|
|
|
|
}
|
2012-05-13 09:18:06 +08:00
|
|
|
f = grd;
|
2012-05-14 01:27:40 +08:00
|
|
|
context.fillStyle = f;
|
|
|
|
context.fill();
|
2012-05-13 09:18:06 +08:00
|
|
|
}
|
|
|
|
// radial gradient
|
|
|
|
else if(s.radius !== undefined && e.radius !== undefined) {
|
|
|
|
var context = this.getContext();
|
2012-05-21 02:12:07 +08:00
|
|
|
var grd = context.createRadialGradient(s.x, s.y, s.radius, e.x, e.y, e.radius);
|
|
|
|
var colorStops = fill.colorStops;
|
|
|
|
|
|
|
|
// build color stops
|
|
|
|
for(var n = 0; n < colorStops.length; n += 2) {
|
|
|
|
grd.addColorStop(colorStops[n], colorStops[n + 1]);
|
|
|
|
}
|
2012-05-13 09:18:06 +08:00
|
|
|
f = grd;
|
2012-05-14 01:27:40 +08:00
|
|
|
context.fillStyle = f;
|
|
|
|
context.fill();
|
2012-05-13 09:18:06 +08:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
f = 'black';
|
2012-05-14 01:27:40 +08:00
|
|
|
context.fillStyle = f;
|
|
|
|
context.fill();
|
2012-05-04 05:20:50 +08:00
|
|
|
}
|
2012-03-07 13:45:48 +08:00
|
|
|
}
|
2012-05-27 11:34:36 +08:00
|
|
|
context.restore();
|
|
|
|
|
|
|
|
if(appliedShadow) {
|
|
|
|
this.fill();
|
|
|
|
}
|
2012-03-07 13:45:48 +08:00
|
|
|
},
|
2012-03-31 14:57:10 +08:00
|
|
|
/**
|
2012-05-27 11:34:36 +08:00
|
|
|
* helper method to fill text and appy shadows if needed
|
2012-06-14 17:19:51 +08:00
|
|
|
* @param {String} text
|
|
|
|
* @param {Number} x
|
|
|
|
* @param {Number} y
|
2012-03-31 14:57:10 +08:00
|
|
|
*/
|
2012-05-27 11:34:36 +08:00
|
|
|
fillText: function(text, x, y) {
|
|
|
|
var appliedShadow = false;
|
2012-03-31 14:57:10 +08:00
|
|
|
var context = this.getContext();
|
2012-05-27 11:34:36 +08:00
|
|
|
context.save();
|
|
|
|
if(this.attrs.textFill !== undefined) {
|
|
|
|
if(!this.appliedShadow) {
|
|
|
|
appliedShadow = this._applyShadow();
|
|
|
|
}
|
|
|
|
context.fillStyle = this.attrs.textFill;
|
|
|
|
context.fillText(text, x, y);
|
|
|
|
}
|
|
|
|
context.restore();
|
|
|
|
|
|
|
|
if(appliedShadow) {
|
|
|
|
this.fillText(text, x, y);
|
2012-03-31 14:57:10 +08:00
|
|
|
}
|
|
|
|
},
|
2012-05-09 14:06:13 +08:00
|
|
|
/**
|
2012-05-27 11:34:36 +08:00
|
|
|
* helper method to stroke text and apply shadows
|
|
|
|
* if needed
|
2012-06-14 17:19:51 +08:00
|
|
|
* @param {String} text
|
|
|
|
* @param {Number} x
|
|
|
|
* @param {Number} y
|
2012-05-09 14:06:13 +08:00
|
|
|
*/
|
2012-05-27 11:34:36 +08:00
|
|
|
strokeText: function(text, x, y) {
|
|
|
|
var appliedShadow = false;
|
2012-05-21 01:47:28 +08:00
|
|
|
var context = this.getContext();
|
|
|
|
context.save();
|
2012-05-27 11:34:36 +08:00
|
|
|
if(this.attrs.textStroke !== undefined || this.attrs.textStrokeWidth !== undefined) {
|
|
|
|
if(!this.appliedShadow) {
|
|
|
|
appliedShadow = this._applyShadow();
|
|
|
|
}
|
2012-05-21 01:47:28 +08:00
|
|
|
|
2012-05-27 11:34:36 +08:00
|
|
|
// defaults
|
|
|
|
if(this.attrs.textStroke === undefined) {
|
|
|
|
this.attrs.textStroke = 'black';
|
|
|
|
}
|
|
|
|
else if(this.attrs.textStrokeWidth === undefined) {
|
|
|
|
this.attrs.textStrokeWidth = 2;
|
|
|
|
}
|
|
|
|
context.lineWidth = this.attrs.textStrokeWidth;
|
|
|
|
context.strokeStyle = this.attrs.textStroke;
|
|
|
|
context.strokeText(text, x, y);
|
2012-05-21 01:47:28 +08:00
|
|
|
}
|
2012-05-27 11:34:36 +08:00
|
|
|
context.restore();
|
|
|
|
|
|
|
|
if(appliedShadow) {
|
|
|
|
this.strokeText(text, x, y);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* helper method to draw an image and apply
|
|
|
|
* a shadow if neede
|
|
|
|
*/
|
|
|
|
drawImage: function() {
|
|
|
|
var appliedShadow = false;
|
|
|
|
var context = this.getContext();
|
|
|
|
context.save();
|
|
|
|
var a = arguments;
|
|
|
|
|
|
|
|
if(a.length === 5 || a.length === 9) {
|
|
|
|
if(!this.appliedShadow) {
|
|
|
|
appliedShadow = this._applyShadow();
|
|
|
|
}
|
|
|
|
switch(a.length) {
|
|
|
|
case 5:
|
|
|
|
context.drawImage(a[0], a[1], a[2], a[3], a[4]);
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
context.drawImage(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);
|
|
|
|
break;
|
|
|
|
}
|
2012-05-21 01:47:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
context.restore();
|
2012-05-27 11:34:36 +08:00
|
|
|
|
|
|
|
if(appliedShadow) {
|
|
|
|
this.drawImage.apply(this, arguments);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* helper method to set the line join of a shape
|
|
|
|
* based on the lineJoin property
|
|
|
|
*/
|
|
|
|
applyLineJoin: function() {
|
|
|
|
var context = this.getContext();
|
|
|
|
if(this.attrs.lineJoin !== undefined) {
|
|
|
|
context.lineJoin = this.attrs.lineJoin;
|
|
|
|
}
|
2012-05-21 01:47:28 +08:00
|
|
|
},
|
2012-06-02 15:39:17 +08:00
|
|
|
/**
|
|
|
|
* apply shadow. return true if shadow was applied
|
|
|
|
* and false if it was not
|
|
|
|
*/
|
2012-05-21 01:47:28 +08:00
|
|
|
_applyShadow: function() {
|
2012-05-09 14:06:13 +08:00
|
|
|
var context = this.getContext();
|
2012-05-20 12:14:04 +08:00
|
|
|
var s = this.attrs.shadow;
|
|
|
|
|
2012-06-02 15:39:17 +08:00
|
|
|
if(s !== undefined) {
|
|
|
|
var aa = this.getAbsoluteAlpha();
|
|
|
|
var sa = this.attrs.shadow.alpha;
|
|
|
|
|
|
|
|
if(sa !== undefined && s.color !== undefined) {
|
|
|
|
context.globalAlpha = sa * aa;
|
|
|
|
context.shadowColor = s.color;
|
|
|
|
context.shadowBlur = s.blur;
|
|
|
|
context.shadowOffsetX = s.offset.x;
|
|
|
|
context.shadowOffsetY = s.offset.y;
|
|
|
|
this.appliedShadow = true;
|
|
|
|
return true;
|
|
|
|
}
|
2012-05-09 14:06:13 +08:00
|
|
|
}
|
2012-05-27 11:34:36 +08:00
|
|
|
|
|
|
|
return false;
|
2012-05-09 14:06:13 +08:00
|
|
|
},
|
2012-04-02 10:38:30 +08:00
|
|
|
/**
|
2012-04-05 10:53:11 +08:00
|
|
|
* save shape data when using pixel detection.
|
2012-04-02 10:38:30 +08:00
|
|
|
*/
|
2012-04-09 11:25:31 +08:00
|
|
|
saveData: function() {
|
2012-04-02 10:38:30 +08:00
|
|
|
var stage = this.getStage();
|
2012-04-06 14:48:58 +08:00
|
|
|
var w = stage.attrs.width;
|
|
|
|
var h = stage.attrs.height;
|
2012-04-02 10:38:30 +08:00
|
|
|
|
|
|
|
var bufferLayer = stage.bufferLayer;
|
|
|
|
var bufferLayerContext = bufferLayer.getContext();
|
|
|
|
|
|
|
|
bufferLayer.clear();
|
|
|
|
this._draw(bufferLayer);
|
|
|
|
|
|
|
|
var imageData = bufferLayerContext.getImageData(0, 0, w, h);
|
|
|
|
this.data = imageData.data;
|
|
|
|
},
|
2012-04-09 11:25:31 +08:00
|
|
|
/**
|
|
|
|
* clear shape data
|
|
|
|
*/
|
|
|
|
clearData: function() {
|
|
|
|
this.data = [];
|
|
|
|
},
|
2012-04-16 00:18:30 +08:00
|
|
|
/**
|
2012-04-28 11:54:49 +08:00
|
|
|
* determines if point is in the shape
|
2012-06-18 07:50:04 +08:00
|
|
|
* @param {Object|Array} point point can be an object containing
|
|
|
|
* an x and y property, or it can be an array with two elements
|
|
|
|
* in which the first element is the x component and the second
|
|
|
|
* element is the y component
|
2012-04-16 00:18:30 +08:00
|
|
|
*/
|
2012-04-28 14:57:01 +08:00
|
|
|
intersects: function() {
|
2012-05-14 01:46:49 +08:00
|
|
|
var pos = Kinetic.GlobalObject._getXY(arguments);
|
2012-04-16 00:18:30 +08:00
|
|
|
var stage = this.getStage();
|
|
|
|
|
|
|
|
if(this.attrs.detectionType === 'path') {
|
|
|
|
var pathLayer = stage.pathLayer;
|
|
|
|
var pathLayerContext = pathLayer.getContext();
|
|
|
|
|
|
|
|
this._draw(pathLayer);
|
|
|
|
|
|
|
|
return pathLayerContext.isPointInPath(pos.x, pos.y);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
var w = stage.attrs.width;
|
|
|
|
var alpha = this.data[((w * pos.y) + pos.x) * 4 + 3];
|
|
|
|
return (alpha !== undefined && alpha !== 0);
|
|
|
|
}
|
|
|
|
},
|
2012-03-07 13:45:48 +08:00
|
|
|
_draw: function(layer) {
|
2012-05-20 12:14:04 +08:00
|
|
|
if(layer !== undefined && this.attrs.drawFunc !== undefined) {
|
2012-03-07 13:45:48 +08:00
|
|
|
var stage = layer.getStage();
|
|
|
|
var context = layer.getContext();
|
2012-04-15 09:27:06 +08:00
|
|
|
var family = [];
|
|
|
|
var parent = this.parent;
|
|
|
|
|
|
|
|
family.unshift(this);
|
|
|
|
while(parent) {
|
|
|
|
family.unshift(parent);
|
|
|
|
parent = parent.parent;
|
|
|
|
}
|
2012-03-24 14:39:54 +08:00
|
|
|
|
2012-03-23 04:47:37 +08:00
|
|
|
context.save();
|
2012-04-15 09:27:06 +08:00
|
|
|
for(var n = 0; n < family.length; n++) {
|
|
|
|
var node = family[n];
|
|
|
|
var t = node.getTransform();
|
2012-04-15 07:27:00 +08:00
|
|
|
|
2012-04-15 09:27:06 +08:00
|
|
|
// center offset
|
2012-06-10 07:13:25 +08:00
|
|
|
if(node.attrs.offset.x !== 0 || node.attrs.offset.y !== 0) {
|
|
|
|
t.translate(-1 * node.attrs.offset.x, -1 * node.attrs.offset.y);
|
2012-04-15 09:27:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
var m = t.getMatrix();
|
|
|
|
context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
|
|
|
}
|
2012-04-15 07:27:00 +08:00
|
|
|
|
2012-05-10 13:31:55 +08:00
|
|
|
this.tempLayer = layer;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* pre styles include alpha, linejoin, and line cap
|
|
|
|
*/
|
2012-04-15 07:27:00 +08:00
|
|
|
if(this.getAbsoluteAlpha() !== 1) {
|
|
|
|
context.globalAlpha = this.getAbsoluteAlpha();
|
2012-03-07 13:45:48 +08:00
|
|
|
}
|
2012-05-10 13:31:55 +08:00
|
|
|
this.applyLineJoin();
|
2012-04-15 07:27:00 +08:00
|
|
|
|
2012-05-10 13:31:55 +08:00
|
|
|
// draw the shape
|
2012-05-27 11:34:36 +08:00
|
|
|
this.appliedShadow = false;
|
2012-05-20 12:14:04 +08:00
|
|
|
this.attrs.drawFunc.call(this);
|
2012-03-07 13:45:48 +08:00
|
|
|
context.restore();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
// extend Node
|
2012-03-12 07:05:47 +08:00
|
|
|
Kinetic.GlobalObject.extend(Kinetic.Shape, Kinetic.Node);
|
2012-06-14 17:19:51 +08:00
|
|
|
|
2012-06-11 04:07:09 +08:00
|
|
|
// add setters and getters
|
|
|
|
Kinetic.GlobalObject.addSetters(Kinetic.Shape, ['fill', 'stroke', 'lineJoin', 'strokeWidth', 'shadow', 'drawFunc']);
|
|
|
|
Kinetic.GlobalObject.addGetters(Kinetic.Shape, ['fill', 'stroke', 'lineJoin', 'strokeWidth', 'shadow', 'drawFunc']);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set fill which can be a color, linear gradient object,
|
|
|
|
* radial gradient object, or pattern object
|
2012-06-14 17:19:51 +08:00
|
|
|
* @name setFill
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
2012-06-11 04:07:09 +08:00
|
|
|
* @param {String|Object} fill
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set stroke color
|
2012-06-14 17:19:51 +08:00
|
|
|
* @name setStroke
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
2012-06-11 04:07:09 +08:00
|
|
|
* @param {String} stroke
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set line join
|
2012-06-14 17:19:51 +08:00
|
|
|
* @name setLineJoin
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
2012-06-11 04:07:09 +08:00
|
|
|
* @param {String} lineJoin. Can be miter, round, or bevel. The
|
|
|
|
* default is miter
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set stroke width
|
2012-06-14 17:19:51 +08:00
|
|
|
* @name setStrokeWidth
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
2012-06-11 04:07:09 +08:00
|
|
|
* @param {Number} strokeWidth
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set shadow object
|
2012-06-14 17:19:51 +08:00
|
|
|
* @name setShadow
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
2012-06-11 04:07:09 +08:00
|
|
|
* @param {Object} config
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set draw function
|
2012-06-14 17:19:51 +08:00
|
|
|
* @name setDrawFunc
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
2012-06-11 04:07:09 +08:00
|
|
|
* @param {Function} drawFunc drawing function
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get fill
|
2012-06-14 17:19:51 +08:00
|
|
|
* @name getFill
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
2012-06-11 04:07:09 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get stroke color
|
2012-06-14 17:19:51 +08:00
|
|
|
* @name getStrokeColor
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
2012-06-11 04:07:09 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get line join
|
2012-06-14 17:19:51 +08:00
|
|
|
* @name getLineJoin
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
2012-06-11 04:07:09 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get stroke width
|
2012-06-14 17:19:51 +08:00
|
|
|
* @name getStrokeWidth
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
2012-06-11 04:07:09 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get shadow object
|
2012-06-14 17:19:51 +08:00
|
|
|
* @name getShadow
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get draw function
|
|
|
|
* @name getDrawFunc
|
|
|
|
* @methodOf Kinetic.Shape.prototype
|
2012-06-11 04:07:09 +08:00
|
|
|
*/
|