draw a shape in sencha touch

2k Views Asked by At

I'm was looking but i cant find a way to draw a shape(circle,square) in sencha touch, just for drag that shape in a tablet. if some one knows how make this, would appreciate the help.

2

There are 2 best solutions below

0
On

You'll want to use ext.draw, which is part of the Sencha Touch Charts add-on for Touch.

0
On

Assuming that you've already included the sencha-touch.js and touch-charts.js files in your index.html...

From the Sencha docs on Ext.draw.Component:

var drawComponent = Ext.create('Ext.draw.Component', {
    viewBox: false,
    items: [{
        type: 'circle',
        fill: '#79BB3F',
        radius: 100,
        x: 100,
        y: 100
    }]
});

Ext.create('Ext.Window', {
    width: 215,
    height: 235,
    layout: 'fit',
    items: [drawComponent]
}).show();