titi82
Nombre de messages : 96 Age : 47 Niveau graphique : aprentie +1 Date d'inscription : 24/10/2008
| Sujet: accumulation de neige sur un texte Ven 9 Jan - 18:11 | |
| voici comment j'ai appris a faire ceci : code 1 : - Code:
-
import flash.display.BitmapData; import flash.geom.Matrix; import flash.geom.Point; import flash.filters.GlowFilter; class SnowFlake { private var a:Number; private var flake:MovieClip; private var tbd:BitmapData; private var mInt:Number; private var glow:GlowFilter; private var tbdP:Point; private var flP:Point; private var mat:Matrix; public function SnowFlake(targBD:BitmapData) { this.tbd = targBD; this.create(); } private function move():Void { this.a += this.flake._xscale / 2000; this.flP.x = this.flake._x; this.flP.y = this.flake._y; if (this.flake._y < Stage.height) { this.flake._y += this.flake._xscale / 50; } else { this.flake.removeMovieClip(); } if (this.flake._x > Stage.width) { this.flake._x = 0; } else if (this.flake._x < 0) { this.flake._x = Stage.width; } else { this.flake._x += Math.sin(this.a) + ((_xmouse - (Stage.width / 2)) / 100); } if (this.tbd.hitTest(this.tbdP, 255, this.flP)) { this.mat.translate(this.flake._x, this.flake._y); this.tbd.draw(this.flake, this.mat); this.remove(); } } private function create():Void { this.tbdP = new Point(this.tbd.rectangle.x, this.tbd.rectangle.y); this.flP = new Point(0, 0); this.glow = new GlowFilter(0xFFFFFF, 100, 5, 5, 3, 1, false, false); this.flake = _root.createEmptyMovieClip("f" + _root.getNextHighestDepth(), _root.getNextHighestDepth()); this.flake.lineStyle(1, 0xFFFFFF, 100); this.flake.moveTo(-1, 0); this.flake.lineTo(1, 0); this.flake.lineTo(0, -1); this.flake.lineTo(0, 1); this.flake._xscale = this.flake._yscale = Math.floor(50 + Math.random() * (150 - 50)); this.flake._x = Math.random() * Stage.width; this.flake.filters = [this.glow]; this.mat = new Matrix(); this.a = 0; this.mInt = setInterval(this, "move", 1000 / 30); } public function remove():Void { this.flake.removeMovieClip(); clearInterval(this.mInt); } } code 2 : - Code:
-
import flash.display.BitmapData; import flash.geom.Matrix; class BitmapText extends BitmapData { private var textMsg:TextField; private var mat:Matrix; public function BitmapText(width:Number, height:Number, xPos:Number, yPos:Number, text:String, fmt:TextFormat, filt:Array) { super(width, height, true, 0); this.textMsg = _root.createTextField("textMsg", 0, 0, 0, 0, 0); this.textMsg.autoSize = true; this.textMsg.setNewTextFormat(fmt); this.textMsg.text = text; this.textMsg.filters = filt; this.mat = new Matrix(); this.mat.translate(xPos, yPos); this.draw(this.textMsg, this.mat); this.textMsg.removeTextField(); } }
code 3 : - Code:
-
import flash.filters.GlowFilter; var glow:GlowFilter = new GlowFilter(0x114468, 100, 2, 5, 3, 3, true, false); var fmt:TextFormat = new TextFormat(); fmt.color = 0x993300; fmt.size = 36; fmt.bold = true; var bt:BitmapText = new BitmapText(Stage.width, Stage.height, 20, 75, "meilleurs voeux 2009", fmt, new Array(glow)); this.createEmptyMovieClip("m", 0); m.attachBitmap(bt, 0); onEnterFrame = function () { new SnowFlake(bt); };
et voici les parametre a personnaliser dans ce dernier : amusez vous bien!! | |
|
Damelodie Graphiste
Nombre de messages : 1814 Age : 30 Niveau graphique : Graphiste ¬¬ Ma galerie : Mon DeviantArt' Date d'inscription : 15/12/2007
| Sujet: Re: accumulation de neige sur un texte Lun 12 Jan - 16:32 | |
| Tout me semble clair et le rendu est sympa ! J'aimerais vraiment essayer... Mais pour l'instant je suis dans l'impossibilité pour raisons personnels donc si quelqu'un d'autre aurait un rendu à montrer,n'hésitez pas !
Titi nous fait des tutos avec amour (du moins je l'espère...) donc un rendu lui ferai grandement plaisir,je suppose.
Et ne me faites pas croire que c'est le logiciel qui vous arrête car je sais que la plupart d'entre vous n'ont pas acheté Photoshop ! Ahah. | |
|
titi82
Nombre de messages : 96 Age : 47 Niveau graphique : aprentie +1 Date d'inscription : 24/10/2008
| Sujet: Re: accumulation de neige sur un texte Mer 14 Jan - 10:37 | |
| merci damelodie, c'est vrai qu'un resultat me ferait plaisir! resouds vite tes soucis perso loulette!!
ps : super ta sign | |
|
Contenu sponsorisé
| Sujet: Re: accumulation de neige sur un texte | |
| |
|