Grafik-Exclu
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.

Grafik-Exclu

Forum de graphisme pour tout logiciel. Rejoignez-nous!
 
AccueilAccueil  AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  ConnexionConnexion  
Le Deal du moment : -50%
-50% Baskets Nike Air Huarache Runner
Voir le deal
69.99 €

 

 accumulation de neige sur un texte

Aller en bas 
2 participants
AuteurMessage
titi82

titi82


Féminin Nombre de messages : 96
Age : 47
Niveau graphique : aprentie +1
Date d'inscription : 24/10/2008

accumulation de neige sur un texte Empty
MessageSujet: accumulation de neige sur un texte   accumulation de neige sur un texte Icon_minitime1Ven 9 Jan - 18:11

voici comment j'ai appris a faire ceci :



accumulation de neige sur un texte Tuto-a10

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 :
accumulation de neige sur un texte As3_ex11

amusez vous bien!!
Revenir en haut Aller en bas
Damelodie
Graphiste
Damelodie


Féminin Nombre de messages : 1814
Age : 30
Niveau graphique : Graphiste ¬¬
Ma galerie : Mon DeviantArt'
Date d'inscription : 15/12/2007

accumulation de neige sur un texte Empty
MessageSujet: Re: accumulation de neige sur un texte   accumulation de neige sur un texte Icon_minitime1Lun 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.
Revenir en haut Aller en bas
http://damelodie.deviantart.com/
titi82

titi82


Féminin Nombre de messages : 96
Age : 47
Niveau graphique : aprentie +1
Date d'inscription : 24/10/2008

accumulation de neige sur un texte Empty
MessageSujet: Re: accumulation de neige sur un texte   accumulation de neige sur un texte Icon_minitime1Mer 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
Revenir en haut Aller en bas
Contenu sponsorisé





accumulation de neige sur un texte Empty
MessageSujet: Re: accumulation de neige sur un texte   accumulation de neige sur un texte Icon_minitime1

Revenir en haut Aller en bas
 
accumulation de neige sur un texte
Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Grafik-Exclu :: Graphisme :: Tutoriels :: Section "FLASH"-
Sauter vers: