View Full Version : Rotate around a fixed point
christine
03-26-2004, 10:31 AM
Is there a way to specify a point around which to rotate? I would like to rotate around the center of the view.
antun
03-26-2004, 12:05 PM
Yes - you use the xoffset and yoffset attributes of view.
Docs here:
http://www.laszlosystems.com/lps-2.1/docs/lzx-reference/?view.html#attr-xoffset
-Antun
mdavis
03-26-2004, 12:58 PM
Play with this to see how it works.
<canvas>
<class name="rotbox" extends="view"
width="100" height="100" bgcolor="red">
<method event="onclick">
this.animate('rotation',360,1000,true);
</method>
</class>
<rotbox />
<rotbox bgcolor="blue" x="150" y="150"
yoffset="${this.height /2}"
xoffset="${this.width / 2}"/>
</canvas>
The main thing to note is that when you change the offset of a view that this effects not only rotation but placement as well.
Enjoy!
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.