O'Reilly logo

Ext JS 4 Web Application Development Cookbook by Stuart Ashworth, Andrew Duncan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Transforming and interacting with shapes

Once we have created a drawing we will sometimes want to update it to reflect a change in the data it is representing or a change in the situation the shape finds itself in. Whatever the reason, the drawing package allows us to easily reconfigure a sprite's characteristics programmatically, both instantly and through a progressive animation.

We will demonstrate how to achieve this by changing the properties of a simple rectangle sprite. The first method we will use is the setAttributes method of the Ext.draw.Sprite class and then we will move on to using the animate method.

How to do it...

  1. Our first step is to create a sprite to work with. We will create a very simple dark blue rectangle and add it to an ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required