-<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-draw.Sprite'>/**
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>The source code</title>
+ <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../prettify/prettify.js"></script>
+ <style type="text/css">
+ .highlight { display: block; background-color: #ddd; }
+ </style>
+ <script type="text/javascript">
+ function highlight() {
+ document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+ }
+ </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+ <pre class="prettyprint lang-js"><span id='Ext-draw-Sprite'>/**
</span> * @class Ext.draw.Sprite
* @extends Object
*
* A Sprite is an object rendered in a Drawing surface. There are different options and types of sprites.
* The configuration of a Sprite is an object with the following properties:
*
- * - **type** - (String) The type of the sprite. Possible options are 'circle', 'path', 'rect', 'text', 'square'.
+ * - **type** - (String) The type of the sprite. Possible options are 'circle', 'path', 'rect', 'text', 'square', 'image'.
* - **width** - (Number) Used in rectangle sprites, the width of the rectangle.
* - **height** - (Number) Used in rectangle sprites, the height of the rectangle.
* - **size** - (Number) Used in square sprites, the dimension of the square.
me.mixins.observable.constructor.apply(this, arguments);
},
-<span id='Ext-draw.Sprite-property-dd'> /**
+<span id='Ext-draw-Sprite-property-dd'> /**
</span> * <p>If this Sprite is configured {@link #draggable}, this property will contain
* an instance of {@link Ext.dd.DragSource} which handles dragging the Sprite.</p>
* The developer must provide implementations of the abstract methods of {@link Ext.dd.DragSource}
me.draggable = true;
//create element if it doesn't exist.
if (!me.el) {
- me.surface.createSprite(me);
+ me.surface.createSpriteElement(me);
}
me.dd = Ext.create('Ext.draw.SpriteDD', me, Ext.isBoolean(me.draggable) ? null : me.draggable);
me.on('beforedestroy', me.dd.destroy, me.dd);
},
-<span id='Ext-draw.Sprite-method-setAttributes'> /**
+<span id='Ext-draw-Sprite-method-setAttributes'> /**
</span> * Change the attributes of the sprite.
* @param {Object} attrs attributes to be changed on the sprite.
* @param {Boolean} redraw Flag to immediatly draw the change.
spriteAttrs = me.attr,
attr, i, translate, translation, rotate, rotation, scale, scaling;
+ attrs = Ext.apply({}, attrs);
for (attr in custom) {
if (attrs.hasOwnProperty(attr) && typeof custom[attr] == "function") {
Ext.apply(attrs, custom[attr].apply(me, [].concat(attrs[attr])));
return this;
},
-<span id='Ext-draw.Sprite-method-getBBox'> /**
+<span id='Ext-draw-Sprite-method-getBBox'> /**
</span> * Retrieve the bounding box of the sprite. This will be returned as an object with x, y, width, and height properties.
* @return {Object} bbox
*/
return this.surface.setText(this, text);
},
-<span id='Ext-draw.Sprite-method-hide'> /**
+<span id='Ext-draw-Sprite-method-hide'> /**
</span> * Hide the sprite.
* @param {Boolean} redraw Flag to immediatly draw the change.
* @return {Ext.draw.Sprite} this
return this;
},
-<span id='Ext-draw.Sprite-method-show'> /**
+<span id='Ext-draw-Sprite-method-show'> /**
</span> * Show the sprite.
* @param {Boolean} redraw Flag to immediatly draw the change.
* @return {Ext.draw.Sprite} this
return this;
},
-<span id='Ext-draw.Sprite-method-remove'> /**
+<span id='Ext-draw-Sprite-method-remove'> /**
</span> * Remove the sprite.
*/
remove: function() {
this.surface.onRemove(this);
},
-<span id='Ext-draw.Sprite-method-destroy'> /**
+<span id='Ext-draw-Sprite-method-destroy'> /**
</span> * Removes the sprite and clears all listeners.
*/
destroy: function() {
}
},
-<span id='Ext-draw.Sprite-method-redraw'> /**
+<span id='Ext-draw-Sprite-method-redraw'> /**
</span> * Redraw the sprite.
* @return {Ext.draw.Sprite} this
*/
return this;
},
-<span id='Ext-draw.Sprite-method-setStyle'> /**
+<span id='Ext-draw-Sprite-method-setStyle'> /**
</span> * Wrapper for setting style properties, also takes single object parameter of multiple styles.
* @param {String/Object} property The style property to be set, or an object of multiple styles.
* @param {String} value (optional) The value to apply to the given property, or null if an object was passed.
return this;
},
-<span id='Ext-draw.Sprite-method-addCls'> /**
+<span id='Ext-draw-Sprite-method-addCls'> /**
</span> * Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out. Note this method
* is severly limited in VML.
* @param {String/Array} className The CSS class to add, or an array of classes
return this;
},
-<span id='Ext-draw.Sprite-method-removeCls'> /**
+<span id='Ext-draw-Sprite-method-removeCls'> /**
</span> * Removes one or more CSS classes from the element.
* @param {String/Array} className The CSS class to remove, or an array of classes. Note this method
* is severly limited in VML.
return this;
}
});
-</pre></pre></body></html>
\ No newline at end of file
+</pre>
+</body>
+</html>