|
SWiSH Forum Forum użytkowników programów SWiSH |
 |
SWiSH Max - morfing?
Pinio - Nie 02 Kwi, 2006 17:16 Temat postu: morfing? Witam. Mam takie pytanko, czy w Maxie da się zrobić coś w rodzaju morfingu np. kółko zamienia się w kwadrat, w ogóle czy da się edytować punkty (vertex) na klatkach kluczowych? We Flashu jest to dość proste.
Pozdrawiam
erbe - Nie 02 Kwi, 2006 17:50
Vertexów nie da sie edytowac w klatkach ale morphing da sie zrobic za pomocą actionscript. Nie rozgryzłem do konca jak to dziala. Morphing
Pinio - Pon 03 Kwi, 2006 08:43
Nezły kawał skryptu,
[ Dodano: Pon 03 Kwi, 2006 10:01 ]
Dzięki, teraz chociaż wiem że się da
Rendfall - Pon 03 Kwi, 2006 16:30
Możecie wkleić w poście skrypt bo mam problem z otwarciem... dzięki!
MBabelek - Wto 04 Kwi, 2006 15:35
Kod: | onFrame (1) {
// code by cortex (c) 2006
var radius = 0;
var xstart = 0;
var ystart = 0;
var boxwidth = 200;
var boxheight = 150;
var ampli = 70;
var speed = 0.95;
var xro = xstart+boxwidth;
var yro = ystart;
var xru = xstart+boxwidth;
var yru = ystart+boxheight;
var xlu = xstart;
var ylu = ystart+boxheight;
var xmstart = (boxwidth-boxheight)/2;
var xmro = (boxwidth-boxheight)/2+boxheight;
var xmru = (boxwidth-boxheight)/2+boxheight;
var xmlu = (boxwidth-boxheight)/2;
var cxo = xstart+boxwidth/2;
var cyre = ystart+(boxheight/2);
var cxu = xstart+boxwidth/2;
var cyli = ystart+boxheight/2;
this._x = Stage.width/2;
this._y = Stage.height/2;
this._xscale = 100;
this._yscale = 100;
kreismalen = function(){
createEmptyMovieClip("kreis",1);
x = Stage.width/2, _y = Stage.height/2;
lineStyle(radius,0x66CCFF,100);
lineTo(0,1);
};
boxmalen = function() {
createEmptyMovieClip("box",1);
lineStyle(0, 0x000000, 0);
beginFill(0x66CCFF, 100);
moveTo(xmstart, ystart);
curveTo(cxo, (ystart-ampli), xmro, yro);
curveTo((xmro+ampli), cyre, xmru, yru);
curveTo(cxu, (ystart+boxheight+ampli), xmlu, ylu);
curveTo((xmlu-ampli), cyli, xmstart, ystart);
endfill();
};
Schatten = new flash.filters.DropShadowFilter (16,110,0x000055,0.2,8,8,1,4,0,0,0);
}
onEnterFrame() {
this.filters = [Schatten];
}
onFrame (2,afterPlacedObjectEvents) {
speed = 0.95;
this.clear();
radius = Math.approach(radius, 250, speed);
this._visible = true;
kreismalen();
}
onFrame (3) {
if (radius >= 217) {
kreis.RemoveSprite();
speed = 0.9;
this._x = Stage.width/2 - boxwidth/2;
this._y = Stage.height/2 - boxheight/2;
gotoAndPlay(4);
} else {
gotoAndPlay(2);
}
}
onFrame (4,afterPlacedObjectEvents) {
this.clear ();
ampli = Math.approach(ampli, 0, speed);
xmstart = Math.approach(xmstart, xstart, speed);
xmro = Math.approach(xmro, xro, speed);
xmru = Math.approach(xmru, xru, speed);
xmlu = Math.approach(xmlu, xlu, speed);
boxmalen();
}
onFrame (5) {
// damit die draw api nicht ewig läuft
// und die teure cpu heiß wird :-)))
if (ampli <= 1) {
ampli = 0;
gotoAndPlay(6);
} else {
gotoAndPlay(4);
}
}
onFrame (6) {
this.clear();
kreis.RemoveSprite();
boxmalen();
_parent.repeat_btn._visible = true;
speed = 0.8;
stop();
}
onFrame (7,afterPlacedObjectEvents) {
_parent.repeat_btn._visible = false;
this.clear ();
ampli = Math.approach(ampli, 70, speed);
boxmalen();
}
onFrame (8) {
if (ampli >= 69) {
gotoAndPlay(9);
} else {
gotoAndPlay(7);
}
}
onFrame (9) {
this._xscale = Math.approach(this._xscale, 0, speed);
this._yscale = this._xscale;
this._x = Math.approach(this._x, Stage.width/2, speed);
this._y = Math.approach(this._y, Stage.height/2, speed);
}
onFrame (10) {
if (this._xscale <= 1) {
this._visible = false;
gotoAndPlay(11);
} else {
gotoAndPlay(9);
}
}
onFrame (25){
gotoAndPlay (1)
}
|
|
|