Package com.anotherbigidea.flash.movie

Examples of com.anotherbigidea.flash.movie.Frame


    }
   
    //----------------------------------------------------------------------------
    public void drawObject(Movie movie, int layer, int speed)
    {
        Frame frame;
        Shape line_shape;
        AlphaColor alpha_color;
        int draw_points = speed + 1;
        Point[] point = new Point[draw_points];
        Instance instance;
       
        if ( points_.size() > 0 )
        {
            alpha_color = new AlphaColor( pen_color_.getRed(), pen_color_.getGreen(), pen_color_.getBlue(), pen_color_.getAlpha() );
            point[0] = (Point) points_.get(0);
           
            // draw all points with stepsize speed
            for (int count = 1; count < points_.size(); count += speed)
            {
                line_shape = new Shape();
                line_shape.defineLineStyle(stroke_.getLineWidth(), alpha_color);
                line_shape.setLineStyle(1);
                line_shape.move(point[0].x, point[0].y);
               
                // draw points for this step ( amount of points = speed + 1 = draw_points )
                for (int point_count = 1; point_count < draw_points; point_count++ )
                {
                    if (count + point_count < points_.size())
                    {
                        point[point_count] = (Point) points_.get(count + point_count);
                        line_shape.line(point[point_count].x, point[point_count].y);
                    }
                }
               
                // draw it into a new frame of SWF
                frame = movie.appendFrame();
                frame.placeSymbol(line_shape, 0, 0);
               
                // the startpoint of next step is our last point.
                point[0] = point[draw_points - 1];
            }
        }
View Full Code Here


    }
   
    //----------------------------------------------------------------------------
    public void drawObject(Movie movie, int layer, int speed)
    {
        Frame frame = movie.appendFrame();
       
        com.anotherbigidea.flash.movie.Image.Lossless img = ImageUtil.createLosslessImage( picture_, SWFConstants.BITMAP_FORMAT_32_BIT, true );
        Shape shape = ImageUtil.shapeForImage( img, (double)picture_.getWidth(), (double)picture_.getHeight() );
       
        Transform transe = new Transform();
        transe.setScaleX(scale_);
        transe.setScaleY(scale_);
        transe.setTranslateX( position_.getX() );
        transe.setTranslateY( position_.getY() );
       
        Instance instance = frame.placeSymbol( shape, transe, null );
       
        // sleep in flash...
        for (int count = 0; count < 5; count++ )
        {
            movie.appendFrame();
View Full Code Here

    }
   
    //----------------------------------------------------------------------------
    public void drawObject(Movie movie, int layer, int speed)
    {
        Frame frame = movie.appendFrame();
        Shape shape = new Shape();
        AlphaColor line_color = new AlphaColor( pen_color_.getRed(), pen_color_.getGreen(), pen_color_.getBlue(), pen_color_.getAlpha() );
       
        if( gradient_ == null )
        {
          AlphaColor fill_color = new AlphaColor( fill_color_.getRed(), fill_color_.getGreen(), fill_color_.getBlue(), fill_color_.getAlpha() );
          shape.defineFillStyle(fill_color);
        }
        else
        {
          shape.defineFillStyle( getGradientColors4Flash(gradient_), getRatios4Flash(gradient_), getTransform4Flash(gradient_), isRadial(gradient_) );
        }

        shape.defineLineStyle((stroke_.getLineWidth()), line_color);
        shape.setLineStyle(1);
        shape.setRightFillStyle(1);
       
        shape.drawAWTPathIterator(rect_.getPathIterator(null));
       
        Instance instance = frame.placeSymbol(shape, 0, 0);
       
        // sleep in flash...
        for (int count = 0; count < 5; count++ )
        {
            movie.appendFrame();
View Full Code Here

    }
   
    //----------------------------------------------------------------------------
    public void drawObject(Movie movie, int layer, int speed)
    {
        Frame frame = movie.appendFrame();
        Shape shape = new Shape();
        AlphaColor line_color = new AlphaColor( pen_color_.getRed(), pen_color_.getGreen(), pen_color_.getBlue(), pen_color_.getAlpha() );
       
        if( gradient_ == null )
        {
          AlphaColor fill_color = new AlphaColor( fill_color_.getRed(), fill_color_.getGreen(), fill_color_.getBlue(), fill_color_.getAlpha() );
          shape.defineFillStyle(fill_color);
        }
        else
        {
          shape.defineFillStyle( getGradientColors4Flash(gradient_), getRatios4Flash(gradient_), getTransform4Flash(gradient_), isRadial(gradient_) );
        }
       
        shape.defineLineStyle((stroke_.getLineWidth()), line_color);
        shape.setLineStyle(1);
        shape.setRightFillStyle(1);
       
        shape.drawAWTPathIterator(ellipse_.getPathIterator(null));

        Instance instance = frame.placeSymbol(shape, 0, 0);
       
        // sleep in flash...
        for (int count = 0; count < 5; count++ )
        {
            movie.appendFrame();
View Full Code Here

    }
   
    //----------------------------------------------------------------------------
    public void drawObject(Movie movie, int layer, int speed)
    {
        Frame frame = movie.appendFrame();
       
        AlphaColor line_color = new AlphaColor( pen_color_.getRed(), pen_color_.getGreen(), pen_color_.getBlue(), pen_color_.getAlpha() );
       
        Shape shape = new Shape();
        shape.defineLineStyle((stroke_.getLineWidth()), line_color);
        shape.setLineStyle(1);
        shape.move( line_.getX1(), line_.getY1());
        shape.line( line_.getX2(), line_.getY2());
       
        Instance instance = frame.placeSymbol(shape, 0, 0);
       
        // sleep in flash...
        for (int count = 0; count < 5; count++ )
        {
            movie.appendFrame();
View Full Code Here

  }

  //----------------------------------------------------------------------------
  protected void noEffect(Movie movie, int speed)
  {
    Frame frame = movie.appendFrame();
    AlphaColor fill_color = new AlphaColor(font_.getColor().getRed(), font_.getColor().getGreen(), font_.getColor().getBlue(), font_.getColor().getAlpha());
    GlyphVector glyphs = font_.getAWTFont().layoutGlyphVector(DrawSWFFont.CONTEXT, font_.getText().toCharArray(), 0, font_.getText().length(), Font.LAYOUT_LEFT_TO_RIGHT);

    Shape shape = new Shape();
    shape.defineFillStyle(fill_color);
    shape.setRightFillStyle(1);
    shape.drawAWTPathIterator(glyphs.getOutline().getPathIterator(null));

    Instance instance = frame.placeSymbol(shape, (int) position_.getX(), (int) position_.getY());

    waitMovie(movie, speed);
  }
View Full Code Here

  }

  //----------------------------------------------------------------------------
  protected void fadeIn(Movie movie, int speed)
  {
    Frame frame;
    Instance instance;
    AlphaColor fill_color = new AlphaColor(font_.getColor().getRed(), font_.getColor().getGreen(), font_.getColor().getBlue(), font_.getColor().getAlpha());
    GlyphVector glyphs = font_.getAWTFont().layoutGlyphVector(DrawSWFFont.CONTEXT, font_.getText().toCharArray(), 0, font_.getText().length(), Font.LAYOUT_LEFT_TO_RIGHT);
    Shape shape = new Shape();
    shape.defineFillStyle(fill_color);
    shape.setRightFillStyle(1);
    shape.drawAWTPathIterator(glyphs.getOutline().getPathIterator(null));

    double width = glyphs.getLogicalBounds().getWidth() / 2.0;
    double center = position_.getX() + width;
    double scale = 2.0;

    frame = movie.appendFrame();
    instance = frame.placeSymbol(shape, new Transform(), new AlphaTransform());
    alterFrame(frame, instance, center - width * scale, position_.getY(), scale, 0.5, 0.025);

    for (int i = speed; i <= 40; i += speed)
    {
      frame = movie.appendFrame();
View Full Code Here

  }

  //----------------------------------------------------------------------------
  protected void typeLetters(Movie movie, int speed)
  {
    Frame frame;
    Instance instance;
    AlphaColor fill_color = new AlphaColor(font_.getColor().getRed(), font_.getColor().getGreen(), font_.getColor().getBlue(), font_.getColor().getAlpha());
    GlyphVector glyphs = font_.getAWTFont().layoutGlyphVector(DrawSWFFont.CONTEXT, font_.getText().toCharArray(), 0, font_.getText().length(), Font.LAYOUT_LEFT_TO_RIGHT);
    Shape shape;

    for (int char_index = 0; char_index < glyphs.getNumGlyphs(); char_index++)
    {
      if (font_.getText().charAt(char_index) != ' ')
      {
        shape = new Shape();
        shape.defineFillStyle(fill_color);
        shape.setRightFillStyle(1);
        shape.drawAWTPathIterator(glyphs.getGlyphOutline(char_index).getPathIterator(null));

        double width = glyphs.getGlyphOutline(char_index).getBounds2D().getX() + glyphs.getGlyphOutline(char_index).getBounds2D().getWidth() / 2.0;
        double height = glyphs.getLogicalBounds().getHeight() / 2.0;
        double center_x = position_.getX() + width;
        double center_y = position_.getY() - height;
        double scale = 2.0;

        frame = movie.appendFrame();
        instance = frame.placeSymbol(shape, new Transform(), new AlphaTransform());
        alterFrame(frame, instance, center_x - width * scale, center_y + height * scale, scale, scale, 0.05);

        for (int i = speed; i <= 10; i += speed)
        {
          frame = movie.appendFrame();
View Full Code Here

   
    //----------------------------------------------------------------------------
    public void generateFile( String filename, LinkedList draw_list )
    {
        DrawObject draw_object;
        Frame frame;
        Movie movie = new Movie();
       
        // movie.setBackcolor(new Color(255,255,255)); // is default
        movie.setWidth( size_.width );
        movie.setHeight( size_.height );
       
        for( int count = 0; count < draw_list.size(); count++ )
        {
            draw_object = (DrawObject) draw_list.get(count);
            if ( draw_object != null )
            {
                draw_object.drawObject(movie, count + 1, speed_);
            }
        }

        frame = movie.appendFrame();
        frame.stop()
       
        try
        {
            movie.write(filename);
        }
View Full Code Here

      }
      Movie movie = new Movie(width, height, 1, 5, null);
      for (int i = 0; i < image.length; i++) {
        if (DelayTime[i] > 1000) {
          for (int j = 0; j < (DelayTime[i]) / 1000; j++) {
            Frame frame = movie.appendFrame();

            frame.placeSymbol(image[i], 0, 0);
          }
        } else {
          Frame frame = movie.appendFrame();

          frame.placeSymbol(image[i], 0, 0);

        }
      }
      // 文件输出
View Full Code Here

TOP

Related Classes of com.anotherbigidea.flash.movie.Frame

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.