Module Ext_draw_Surface


module Ext_draw_Surface: sig .. end
A Surface is an interface to render methods inside ...

A Surface is an interface to render methods inside Ext.draw.Component.

Most of the Surface methods are abstract and they have a concrete implementation in VML or SVG engines.

A Surface contains methods to render sprites, get bounding boxes of sprites, add sprites to the canvas, initialize other graphic components, etc.

Adding sprites to surface

One of the most used methods for this class is the add method, to add Sprites to the surface. For example:

drawComponent.surface.add({
    type: 'circle',
    fill: '#ffc',
    radius: 100,
    x: 100,
    y: 100
});

The configuration object passed in the add method is the same as described in the Ext.draw.Sprite class documentation.

Sprites can also be added to surface by setting their surface config at creation time:

var sprite = Ext.create('Ext.draw.Sprite', {
    type: 'circle',
    fill: '#ff0',
    surface: drawComponent.surface,
    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);


class type t = object .. end
class type configs = object .. end
class type events = object .. end
class type statics = object .. end
val get_static : unit -> statics Js.t
Static instance for lazy-loaded modules.
val static : statics Js.t
Static instance.
val create : 'a Js.t -> Js.js_string Js.t Js.js_array Js.t Js.optdef -> 'b Js.t
See method statics.create
val save : 'a Js.t -> 'b Js.t Js.optdef -> 'c Js.t
See method statics.save
val of_configs : configs Js.t -> t Js.t
of_configs c casts a config object c to an instance of class t
val to_configs : t Js.t -> configs Js.t
to_configs o casts instance o of class t to a config object