- <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', '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.
- * - **radius** - (Number) Used in circle sprites, the radius of the circle.
- * - **x** - (Number) The position along the x-axis.
- * - **y** - (Number) The position along the y-axis.
- * - **path** - (Array) Used in path sprites, the path of the sprite written in SVG-like path syntax.
- * - **opacity** - (Number) The opacity of the sprite.
- * - **fill** - (String) The fill color.
- * - **stroke** - (String) The stroke color.
- * - **stroke-width** - (Number) The width of the stroke.
- * - **font** - (String) Used with text type sprites. The full font description. Uses the same syntax as the CSS `font` parameter.
- * - **text** - (String) Used with text type sprites. The text itself.
- *
- * Additionally there are three transform objects that can be set with `setAttributes` which are `translate`, `rotate` and
- * `scale`.
- *
- * For translate, the configuration object contains x and y attributes that indicate where to
- * translate the object. For example:
- *
- * sprite.setAttributes({
- * translate: {
- * x: 10,
- * y: 10
- * }
- * }, true);
- *
- * For rotation, the configuration object contains x and y attributes for the center of the rotation (which are optional),
- * and a `degrees` attribute that specifies the rotation in degrees. For example:
- *
- * sprite.setAttributes({
- * rotate: {
- * degrees: 90
- * }
- * }, true);
- *
- * For scaling, the configuration object contains x and y attributes for the x-axis and y-axis scaling. For example:
- *
- * sprite.setAttributes({
- * scale: {
- * x: 10,
- * y: 3
- * }
- * }, true);
- *
- * Sprites can be created with a reference to a {@link Ext.draw.Surface}
- *
- * var drawComponent = Ext.create('Ext.draw.Component', options here...);
- *
- * var sprite = Ext.create('Ext.draw.Sprite', {
- * type: 'circle',
- * fill: '#ff0',
- * surface: drawComponent.surface,
- * radius: 5
- * });
- *
- * Sprites can also be added to the surface as a configuration object:
- *
- * var sprite = drawComponent.surface.add({
- * type: 'circle',
- * fill: '#ff0',
- * radius: 5
- * });
- *
- * In order to properly apply properties and render the sprite we have to
- * `show` the sprite setting the option `redraw` to `true`:
- *
- * sprite.show(true);
- *
- * The constructor configuration object of the Sprite can also be used and passed into the {@link Ext.draw.Surface}
- * add method to append a new sprite to the canvas. For example:
- *
- * drawComponent.surface.add({
- * type: 'circle',
- * fill: '#ffc',
- * radius: 100,
- * x: 100,
- * y: 100
- * });
- */
-Ext.define('Ext.draw.Sprite', {
- /* Begin Definitions */
-
- mixins: {
- observable: 'Ext.util.Observable',
- animate: 'Ext.util.Animate'
- },