dist/melonjs.js
function fillPolygon(poly) {
         var points = poly.points;
         var glPoints = this._glPoints;
         var indices = poly.getIndices();
         var x = poly.pos.x,
             y = poly.pos.y; // Grow internal points buffer if necessary

         for (i = glPoints.length; i < indices.length; i++) {
           glPoints.push(new me.Vector2d());
         } // calculate all vertices


         for (var i = 0; i < indices.length; i++) {
           glPoints[i].set(x + points[indices[i]].x, y + points[indices[i]].y);
         } // draw all triangle


         this.compositor.drawTriangle(glPoints, indices.length);
       }
function fillPolygon(poly) {
         var points = poly.points;
         var glPoints = this._glPoints;
         var indices = poly.getIndices();
         var x = poly.pos.x,
             y = poly.pos.y; // Grow internal points buffer if necessary

         for (i = glPoints.length; i < indices.length; i++) {
           glPoints.push(new me.Vector2d());
         } // calculate all vertices


         for (var i = 0; i < indices.length; i++) {
           glPoints[i].set(x + points[indices[i]].x, y + points[indices[i]].y);
         } // draw all triangle


         this.compositor.drawTriangle(glPoints, indices.length);
       }
function fillPolygon ( poly ) { var points = poly . points ; var glPoints = this . _glPoints ; var indices = poly . getIndices ( ) ; var x = poly . pos . x , y = poly . pos . y ; // Grow internal points buffer if necessary for ( i = glPoints . length ; i < indices . length ; i ++ ) { glPoints . push ( new me . Vector2d ( ) ) ; } // calculate all vertices for ( var i = 0 ; i < indices . length ; i ++ ) { glPoints [ i ] . set ( x + points [ indices [ i ] ] . x , y + points [ indices [ i ] ] . y ) ; } // draw all triangle this . compositor . drawTriangle ( glPoints , indices . length ) ; }
Fill a me.Polygon on the screen
@name fillPolygon
@memberOf me.WebGLRenderer.prototype
@function
@param {me.Polygon} poly the shape to draw
Fill a me . Polygon on the screen