From: Richard B. <ma...@ri...> - 2001-10-30 22:39:23
|
Hi, Checkout the pathanim examples in release 2.55a, you will see the slideTo function is available there. You now include pathanim.js and thread.js, when animation is needed. This was done because thread.js should work as a load-balancer, which gives all your animations the same priority. slideBy was dropped, as it was though so simple to do : myLayer.slideTo(myLayer.getX()+10,null) Not everyone agreed with this at the time, but that's the way it turned out. It might be a nice idea to have a official library of addon functions that work with DynAPI (there is also a nice glide script available), but most effort is going into browser compatibility, and performance at the moment. Cheers, Richard. www.richardinfo.com ----- Original Message ----- From: "Laszlo Teglas" <las...@po...> To: <Dyn...@li...> Sent: Tuesday, October 30, 2001 10:59 PM Subject: [Dynapi-Chat] slide utility > > This slide utility was part of the DynAPI 2.0 > Why was it taken out? > It is very handy, and still works with the new 2.55a version (as far as I > can tell from the limited testing i've done). > > Please put it back in the package: > > > /* > DynAPI Distribution > Slide Extensions > Modified: 2000.10.27 > > The DynAPI Distribution is distributed under the terms of the GNU LGPL > license. > */ > DynLayer.prototype.slideTo = function (endx,endy,inc,speed) { > if (endx==null) endx = this.x > if (endy==null) endy = this.y > var distx = endx-this.x > var disty = endy-this.y > this.slideStart(endx,endy,distx,disty,inc,speed) > } > DynLayer.prototype.slideBy = function (distx,disty,inc,speed) { > if (distx==null) distx = 0 > if (disty==null) disty = 0 > var endx = this.x+distx > var endy = this.y+disty > this.slideStart(endx,endy,distx,disty,inc,speed) > } > DynLayer.prototype.slideStart = function (endx,endy,distx,disty,inc,speed) { > if (this.slideActive) return > if (!inc) inc = 10 > if (!speed) speed = 20 > this.slideN = Math.floor(Math.sqrt(Math.pow(distx,2) + > Math.pow(disty,2))/inc) > if (this.slideN==0) return > this.slideEndX = endx > this.slideEndY = endy > this.slideDX = distx/this.slideN > this.slideDY = disty/this.slideN > this.slideActive = true > this.slideI = 0 > this.slideInterval = setInterval(this+".slide()",speed) > } > DynLayer.prototype.slide = function () { > if (!this.slideActive) { > clearInterval(this.slideInterval) > this.slideActive = false > } > else if (this.slideI++ < this.slideN) { > this.moveBy(this.slideDX,this.slideDY) > this.invokeEvent("slide") > } > else { > this.moveTo(this.slideEndX,this.slideEndY) > this.invokeEvent("slide") > this.slideActive = false > clearInterval(this.slideInterval) > this.invokeEvent("slideend") > } > } > > > _______________________________________________ > Dynapi-Chat mailing list > Dyn...@li... > https://lists.sourceforge.net/lists/listinfo/dynapi-chat > |