|
SWiSH Forum Forum użytkowników programów SWiSH |
 |
SWiSH Max - Efekt - boxy
krzywy105 - Pią 27 Kwi, 2012 12:21 Temat postu: Efekt - boxy Witam.
Chciałbym się poradzić jak uzyskać podobny efekt jak na poniższej stronie (chodzi o flash z 6 poruszającymi się boxami).
http://www.jewelosco.com/
Głównie chodzi mi o poruszanie całością z względu na położenie myszy i efekt zmiany perspektywy (boczne boxy).
Ma ktoś jakiś pomysł?
espe1 - Sob 28 Kwi, 2012 10:17
co do poruszania:
Kod: |
var origin = new flash.geom.Point(150, 150);
var maxdistance = 40; // distance allowd to move from origin
var mouserange = 400; // distance from origin the mouse is effective
var easefactor = 15; // ease factor for moving face
mc._x = origin.x;
mc._y = origin.y;
mc.target = origin.clone();
mc.onEnterFrame = function() {
var dx = this._parent._xmouse - origin.x;
var dy = this._parent._ymouse - origin.y;
var angle = Math.atan2(dy, dx);
var dist = Math.sqrt(dx*dx + dy*dy);
dist = Math.min(dist, mouserange);
var amount = dist/mouserange;
var movement = amount * maxdistance;
this.target.x = origin.x + movement * Math.cos(angle);
this.target.y = origin.y + movement * Math.sin(angle);
this._x += (this.target.x - this._x)/easefactor;
this._y += (this.target.y - this._y)/easefactor;
} |
co do perspektywy to w swishu:
- skew image
- morphing
- lub przeróbka jakiegoś efektu, np. 3D Spin perspective
|
|