Loading:


    Matrix clone [AS 2]

    Klasa: Matrix

    Kompatybilność: ActionScript 1.0, Flash 8+

     

    Zwraca nowy obiekt Matrix, który jest identycznym klonem tego matrix'a.



    Napisz Artyku³

    Listing

    import flash.geom.Matrix;

    var mojMatrix:Matrix = new Matrix(2, 0, 0, 2, 0, 0);
    var sklonowanyMatrix:Matrix = new Matrix();

    trace(mojMatrix); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
    trace(sklonowanyMatrix); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
    trace(equals(mojMatrix, sklonowanyMatrix)); // false

    sklonowanyMatrix = mojMatrix.clone();

    trace(mojMatrix); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
    trace(sklonowanyMatrix); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
    trace(equals(mojMatrix, sklonowanyMatrix)); // true

    function equals(m1:Matrix, m2:Matrix):Boolean {
        return m1.toString() == m2.toString();
    }
     




    Dodano przez: divix
    Ranga: Administrator serwisu Punktów: 0
    Komentarze użytkowników
      • Tre¶æ komentarza
        Kod do komentarza (opcjonalnie)
        PHP JavaScript MySQL Smarty SQL HTML CSS ActionScript
        Autor
        Token
        token

         

         








    funkcje.net
    Wszelkie prawa zastrzeżone©. | Funkcje.net 2008-2025 v.1.5 | design: diviXdesign & rainbowcolors