Visualizzazione dei risultati da 1 a 4 su 4

Discussione: creare un cerchio

  1. #1
    Utente bannato
    Registrato dal
    Aug 2001
    Messaggi
    696

    creare un cerchio

    Seguendo l'articolo
    http://flash-mx.html.it/articoli/vie...olo=28&idpag=2

    si riesce a creare semplicemente un cerchio con

    MovieClip.prototype.drawCircle = function(x,y,radius, startAngle, endAngle, segments) {
    Math.rad = Math.PI/180;
    lineStyle(1, 0x000000, 100);
    var segm = (endAngle-startAngle)/segments;
    this.moveTo(x+radius*Math.cos(startAngle*Math.rad) ,
    y+radius*Math.sin(startAngle*Math.rad));
    for (var s = startAngle+segm; s<=endAngle+1; s += segm) {
    var c_x = radius*Math.cos(s*Math.rad);
    var c_y = radius*Math.sin(s*Math.rad);
    var a_x = c_x+radius*Math.tan(segm/2*Math.rad)*Math.cos((s-90)*Math.rad);
    var a_y = c_y+radius*Math.tan(segm/2*Math.rad)*Math.sin((s-90)*Math.rad);
    this.curveTo(a_x+x, a_y+y, c_x+x, c_y+y);
    }
    }

    // creazione del cechio
    this.drawCircle(200,200,100,0,360,8);

    Però non riesco a creare il cerchio dentro ad un clip

  2. #2
    lineStyle(1, 0x000000, 100);

    deve diventare

    this.lineStyle(1, 0x000000, 100);

    e poi naturalmente devi creare la clip ed applicarle il metodo.

  3. #3
    Utente bannato
    Registrato dal
    Aug 2001
    Messaggi
    696
    ti amo

    :metallica :metallica :metallica

  4. #4

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.