Package com.anotherbigidea.flash.movie

Examples of com.anotherbigidea.flash.movie.Shape


   
       int[] size = new int[2];
       //--open the JPEG
          FileInputStream jpegIn = new FileInputStream( fileName );
        
       Shape image =  ImageUtil.shapeForImage( jpegIn, size );
         
          int width  = size[0];
          int height = size[1];
          jpegIn.close();
         
          //--Add a black border to the image shape (origin is in top left corner)
          image.defineLineStyle( 1, null )//default color is black
          image.setLineStyle( 1 );
          image.line( width, 0 );
          image.line( width, height );
          image.line( 0, height );
          image.line( 0, 0 );       
         
          //String outputFileName = "output.swf";
         
         
          File file = new File(swfFileName);
View Full Code Here


   
    //----------------------------------------------------------------------------
    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();
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() );
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++ )
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++ )
View Full Code Here

    {
        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++ )
View Full Code Here

  {
    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

  {
    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;
View Full Code Here

  {
    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;
View Full Code Here

TOP

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

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.