FairyGUI.NGraphics.FillTriangles C# (CSharp) Method

FillTriangles() public method

public FillTriangles ( ) : void
return void
        public void FillTriangles()
        {
            int vertCount = this.vertices.Length;
            AllocTriangleArray((vertCount >> 1) * 3);

            int k = 0;
            for (int i = 0; i < vertCount; i += 4)
            {
                triangles[k++] = i;
                triangles[k++] = i + 1;
                triangles[k++] = i + 2;

                triangles[k++] = i + 2;
                triangles[k++] = i + 3;
                triangles[k++] = i;
            }
        }

Same methods

NGraphics::FillTriangles ( int triangles ) : void

Usage Example

 static public int FillTriangles(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 1)
         {
             FairyGUI.NGraphics self = (FairyGUI.NGraphics)checkSelf(l);
             self.FillTriangles();
             pushValue(l, true);
             return(1);
         }
         else if (argc == 2)
         {
             FairyGUI.NGraphics self = (FairyGUI.NGraphics)checkSelf(l);
             System.Int32[]     a1;
             checkArray(l, 2, out a1);
             self.FillTriangles(a1);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }