Class type Ext_draw_Sprite.t


class type t = object .. end
Inherits
method dd : Ext_dd_DragSource.t Js.t Js.prop

If this Sprite is configured draggable, this property will contain an instance of Ext.dd.DragSource which handles dragging the Sprite.

The developer must provide implementations of the abstract methods of Ext.dd.DragSource in order to supply behaviour for each stage of the drag/drop process. See draggable.


method isSprite : bool Js.t Js.prop

true in this class to identify an object as an instantiated Sprite, or subclass thereof.

Defaults to: true

method addCls : 'a.
'a Js.t ->
(< addCls : 'a. 'b; addEvents : 'd. 'd Js.t -> unit Js.meth;
addListener : 'e 'f 'g 'h 'i.
'e Js.t ->
'f Js.callback Js.optdef ->
'g Js.t Js.optdef ->
'h Js.t Js.optdef -> 'i Js.t Js.meth;
addManagedListener : 'j 'k 'l 'm 'n 'o.
'j Js.t ->
'k Js.t ->
'l Js.callback Js.optdef ->
'm Js.t Js.optdef ->
'n Js.t Js.optdef -> 'o Js.t Js.meth;
animate : 'p 'q. 'p Js.t -> 'q Js.t Js.meth;
callParent : 'r 's. 'r Js.t -> 's Js.t Js.meth;
callSuper : 't 'u. 't Js.t -> 'u Js.t Js.meth;
clearListeners : unit Js.meth; clearManagedListeners : unit Js.meth;
dd : Ext_dd_DragSource.t Js.t Js.prop; destroy : unit Js.meth;
enableBubble : 'v. 'v Js.t -> unit Js.meth;
fireEvent : 'w. Js.js_string Js.t -> 'w Js.t -> bool Js.t Js.meth;
fireEventArgs : 'x.
Js.js_string Js.t ->
'x Js.t Js.js_array Js.t -> bool Js.t Js.meth;
getActiveAnimation : 'y. 'y Js.t Js.meth; getBBox : 'z. 'z Js.t Js.meth;
getInitialConfig : 'a1. Js.js_string Js.t Js.optdef -> 'a1 Js.t Js.meth;
hasListener : Js.js_string Js.t -> bool Js.t Js.meth;
hasListeners : 'b1. 'b1 Js.t Js.readonly_prop;
hide : bool Js.t -> 'c Js.t Js.meth;
initConfig : 'c1. 'c1 Js.t -> 'c Js.t Js.meth;
isObservable : bool Js.t Js.prop; isSprite : bool Js.t Js.prop;
mon : 'd1 'e1 'f1 'g1 'h1 'i1.
'd1 Js.t ->
'e1 Js.t ->
'f1 Js.callback Js.optdef ->
'g1 Js.t Js.optdef -> 'h1 Js.t Js.optdef -> 'i1 Js.t Js.meth;
mun : 'j1 'k1 'l1 'm1.
'j1 Js.t ->
'k1 Js.t ->
'l1 Js.callback Js.optdef -> 'm1 Js.t Js.optdef -> unit Js.meth;
on : 'n1 'o1 'p1 'q1 'r1.
'n1 Js.t ->
'o1 Js.callback Js.optdef ->
'p1 Js.t Js.optdef -> 'q1 Js.t Js.optdef -> 'r1 Js.t Js.meth;
redraw : 'c Js.t Js.meth;
relayEvents : 's1 't1.
's1 Js.t ->
Js.js_string Js.t Js.js_array Js.t ->
Js.js_string Js.t Js.optdef -> 't1 Js.t Js.meth;
remove : bool Js.t Js.meth;
removeCls : 'u1. 'u1 Js.t -> 'c Js.t Js.meth;
removeListener : 'v1 'w1.
Js.js_string Js.t ->
'v1 Js.callback -> 'w1 Js.t Js.optdef -> unit Js.meth;
removeManagedListener : 'x1 'y1 'z1 'a2.
'x1 Js.t ->
'y1 Js.t ->
'z1 Js.callback Js.optdef ->
'a2 Js.t Js.optdef -> unit Js.meth;
resumeEvent : Js.js_string Js.t -> unit Js.meth;
resumeEvents : unit Js.meth; self : Ext_Class.t Js.t Js.prop;
sequenceFx : 'b2. 'b2 Js.t Js.meth;
setAttributes : 'c2. 'c2 Js.t -> bool Js.t -> 'c Js.t Js.meth;
setStyle : 'd2.
'd2 Js.t -> Js.js_string Js.t Js.optdef -> 'c Js.t Js.meth;
show : bool Js.t -> 'c Js.t Js.meth; statics : Ext_Class.t Js.t Js.meth;
stopAnimation : Ext_dom_Element.t Js.t Js.meth;
suspendEvent : Js.js_string Js.t -> unit Js.meth;
suspendEvents : bool Js.t -> unit Js.meth;
syncFx : 'e2. 'e2 Js.t Js.meth;
un : 'f2 'g2.
Js.js_string Js.t ->
'f2 Js.callback -> 'g2 Js.t Js.optdef -> unit Js.meth;
.. >
as 'c)
Js.t Js.meth as 'b

Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out. Note this method is severly limited in VML.

Parameters:

Returns:


method destroy : unit Js.meth

Removes the sprite and clears all listeners.


method getBBox : 'z. 'z Js.t Js.meth

Retrieves the bounding box of the sprite. This will be returned as an object with x, y, width, and height properties.

Returns:


method hide : bool Js.t -> 'c Js.t Js.meth

Hides the sprite.

Parameters:

Returns:


method redraw : 'c Js.t Js.meth

Redraws the sprite.

Returns:


method remove : bool Js.t Js.meth

Removes the sprite.

Returns:


method removeCls : 'u1. 'u1 Js.t -> 'c Js.t Js.meth

Removes one or more CSS classes from the element.

Parameters:

Returns:


method setAttributes : 'c2. 'c2 Js.t -> bool Js.t -> 'c Js.t Js.meth

Change the attributes of the sprite.

Translation

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);

Rotation

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);

That example will create a 90 degrees rotation using the centroid of the Sprite as center of rotation, whereas:

sprite.setAttributes({
  rotate: {
   x: 0,
   y: 0,
   degrees: 90
  }
}, true);

will create a rotation around the (0, 0) axis.

Scaling

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);

You can also specify the center of scaling by adding cx and cy as properties:

sprite.setAttributes({
  scale: {
   cx: 0,
   cy: 0,
   x: 10,
   y: 3
  }
}, true);

That last example will scale a sprite taking as centers of scaling the (0, 0) coordinate.

Parameters:

Returns:


method setStyle : 'd2. 'd2 Js.t -> Js.js_string Js.t Js.optdef -> 'c Js.t Js.meth

Wrapper for setting style properties, also takes single object parameter of multiple styles.

Parameters:

Returns:


method show : bool Js.t -> 'c Js.t Js.meth

Shows the sprite.

Parameters:

Returns: