Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / source / Sprite.html
index eb3b5b5..0a8e9c3 100644 (file)
@@ -1,11 +1,28 @@
-<!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.
@@ -175,7 +192,7 @@ Ext.define('Ext.draw.Sprite', {
         me.mixins.observable.constructor.apply(this, arguments);
     },
 
-<span id='Ext-draw.Sprite-property-dd'>    /**
+<span id='Ext-draw-Sprite-property-dd'>    /**
 </span>     * &lt;p&gt;If this Sprite is configured {@link #draggable}, this property will contain
      * an instance of {@link Ext.dd.DragSource} which handles dragging the Sprite.&lt;/p&gt;
      * The developer must provide implementations of the abstract methods of {@link Ext.dd.DragSource}
@@ -188,13 +205,13 @@ Ext.define('Ext.draw.Sprite', {
         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.
@@ -211,6 +228,7 @@ Ext.define('Ext.draw.Sprite', {
             spriteAttrs = me.attr,
             attr, i, translate, translation, rotate, rotation, scale, scaling;
 
+        attrs = Ext.apply({}, attrs);
         for (attr in custom) {
             if (attrs.hasOwnProperty(attr) &amp;&amp; typeof custom[attr] == &quot;function&quot;) {
                 Ext.apply(attrs, custom[attr].apply(me, [].concat(attrs[attr])));
@@ -290,7 +308,7 @@ Ext.define('Ext.draw.Sprite', {
         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
      */
@@ -302,7 +320,7 @@ Ext.define('Ext.draw.Sprite', {
         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
@@ -314,7 +332,7 @@ Ext.define('Ext.draw.Sprite', {
         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
@@ -326,7 +344,7 @@ Ext.define('Ext.draw.Sprite', {
         return this;
     },
 
-<span id='Ext-draw.Sprite-method-remove'>    /**
+<span id='Ext-draw-Sprite-method-remove'>    /**
 </span>     * Remove the sprite.
      */
     remove: function() {
@@ -341,7 +359,7 @@ Ext.define('Ext.draw.Sprite', {
         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() {
@@ -354,7 +372,7 @@ Ext.define('Ext.draw.Sprite', {
         }
     },
 
-<span id='Ext-draw.Sprite-method-redraw'>    /**
+<span id='Ext-draw-Sprite-method-redraw'>    /**
 </span>     * Redraw the sprite.
      * @return {Ext.draw.Sprite} this
      */
@@ -363,7 +381,7 @@ Ext.define('Ext.draw.Sprite', {
         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.
@@ -374,7 +392,7 @@ Ext.define('Ext.draw.Sprite', {
         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
@@ -385,7 +403,7 @@ Ext.define('Ext.draw.Sprite', {
         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.
@@ -396,4 +414,6 @@ Ext.define('Ext.draw.Sprite', {
         return this;
     }
 });
-</pre></pre></body></html>
\ No newline at end of file
+</pre>
+</body>
+</html>