nee dhelp con señalar el tipo de línea de puntos ..

  • fifin04
  • Student
  • Student
  • No Avatar
  • Registrado: Mar 16, 2005
  • Mensajes: 70
  • Status: Offline

Nota Octubre 6th, 2005, 8:27 pm

Hola...

1stly...Yo sé cómo dibujar una línea recta utilizando ActionScript, pero mi problema es...cómo dibujar este tipo de línea usando actionscript...

1 ª línea --->.................
2 ª línea ----> __ __ __ __

a fin de Im realmente necesita ayuda aquí ..

Espero que alguien me puede ayudar a cabo...

TQ
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Octubre 6th, 2005, 8:27 pm

  • ShapeShifter
  • Graduate
  • Graduate
  • Avatar de Usuario
  • Registrado: Sep 09, 2005
  • Mensajes: 159
  • Loc: Sweden
  • Status: Offline

Nota Octubre 8th, 2005, 10:22 am

Alguna vez trató de abrir el panel de Propiedades con la herramienta de línea seleccionado? :D

(pista: si usted cambia el grosor de la línea también puede cambiar su apariencia)

Nota Octubre 8th, 2005, 11:40 pm

Si desea dibujar la línea con el panel de ActionScript las propiedades no va a ayudar en todo. Sin saber realmente lo que está tratando de usarlo para que no le puede ayudar mucho, pero suena como usted quiere dibujar una serie de pequeñas líneas entre 2 puntos (en lugar de sólo 1 línea continua).

Esta función puede ayudar a:
Código: [ Download ] [ Select ]
drawDashedLine = function(ax, ay, bx, by, dashLength, thickness, rgb, alpha) {
    var dx = ax-bx;
    var dy = ay-by;
    var angle = Math.atan2(dy, dx)/(Math.PI/180)+90;
    if (angle>180) angle -= 360;
    this.lineStyle(thickness, rgb, alpha);
    this.moveTo(ax, ay);
    for (var i=0; i*dashLength<Math.sqrt(dx*dx+dy*dy); i++) {
        var cx = ax - (i*dashLength)*Math.sin(angle*(Math.PI/180));
        var cy = ay + (i*dashLength)*Math.cos(angle*(Math.PI/180));
        if (i%2 == 0) {
            this.lineTo(cx, cy);
        } else {
            this.moveTo(cx, cy);
        }
    }
};

drawDashedLine(20, 20, 400, 150, 5, 1, 0x000000, 100);
drawDashedLine(400, 150, 200, 175, 5, 1, 0x000000, 100);
drawDashedLine(200, 175, 20, 20, 5, 1, 0x000000, 100);
  1. drawDashedLine = function(ax, ay, bx, by, dashLength, thickness, rgb, alpha) {
  2.     var dx = ax-bx;
  3.     var dy = ay-by;
  4.     var angle = Math.atan2(dy, dx)/(Math.PI/180)+90;
  5.     if (angle>180) angle -= 360;
  6.     this.lineStyle(thickness, rgb, alpha);
  7.     this.moveTo(ax, ay);
  8.     for (var i=0; i*dashLength<Math.sqrt(dx*dx+dy*dy); i++) {
  9.         var cx = ax - (i*dashLength)*Math.sin(angle*(Math.PI/180));
  10.         var cy = ay + (i*dashLength)*Math.cos(angle*(Math.PI/180));
  11.         if (i%2 == 0) {
  12.             this.lineTo(cx, cy);
  13.         } else {
  14.             this.moveTo(cx, cy);
  15.         }
  16.     }
  17. };
  18. drawDashedLine(20, 20, 400, 150, 5, 1, 0x000000, 100);
  19. drawDashedLine(400, 150, 200, 175, 5, 1, 0x000000, 100);
  20. drawDashedLine(200, 175, 20, 20, 5, 1, 0x000000, 100);
  • fifin04
  • Student
  • Student
  • No Avatar
  • Registrado: Mar 16, 2005
  • Mensajes: 70
  • Status: Offline

Nota Octubre 10th, 2005, 7:56 am

gracias por la preocupación de Lord Sivell ..

en realidad no es para lo que yo después de ver...mi mala en realidad, en primer lugar, coz realmente tengo que sacar la línea usando opengl...

de todos modos TQ.

Publicar Información

  • Total de mensajes en este tema: 4 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 76 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2010 Unmelted, LLC. Impulsado por phpBB © 2010 phpBB Group.