コード例 #1
0
ファイル: GUISprite.cs プロジェクト: pgonzbecer/GDToolkit
        public GUISprite(Point2f pos, Size2f size)
        {
            vertices=	new Point3f[4];
            texcoords=	new TexCoord[4];
            colors=	new Color[4];
            faces=	new ushort[6];

            vertices[0]=	new Point3f(pos.x, pos.y, 0f);
            vertices[1]=	new Point3f(pos.x, pos.y+size.height, 0f);
            vertices[2]=	new Point3f(pos.x+size.width, pos.y+size.height, 0f);
            vertices[3]=	new Point3f(pos.x+size.width, pos.y, 0f);

            texcoords[0]=	new TexCoord(0f, 0f);
            texcoords[1]=	new TexCoord(0f, 1f);
            texcoords[2]=	new TexCoord(1f, 1f);
            texcoords[3]=	new TexCoord(1f, 0f);

            applyColor(new Color(255, 255, 255, 255));

            faces[0]=	0;	faces[1]=	1;	faces[2]=	3;
            faces[3]=	1;	faces[4]=	2;	faces[5]=	3;

            bvolume=	new BVRectangle(pos, pos+size);
            comp=	null;
            tb=	new Rectangle(0f, 0f, 1f, 1f);
        }
コード例 #2
0
ファイル: Size3f.cs プロジェクト: pgonzbecer/GDToolkit
 // Subtracts the two sizes together
 public Size3f subtract(Size2f size)
 {
     return new Size3f(width-size.width, height-size.height, depth);
 }
コード例 #3
0
ファイル: Size3f.cs プロジェクト: pgonzbecer/GDToolkit
 // Adds the two sizes together
 public Size3f add(Size2f size)
 {
     return new Size3f(width+size.width, height+size.height, depth);
 }
コード例 #4
0
ファイル: Mathx.cs プロジェクト: pgonzbecer/GDToolkit
        // Gets the minimum value of the size
        public static Size2f min(Size2f value, Size2f min)
        {
            // Variables
            Size2f	temp=	value;

            if(value.width< min.width)
                temp.width=	min.width;
            if(value.height< min.height)
                temp.height=	min.height;

            return temp;
        }
コード例 #5
0
ファイル: Mathx.cs プロジェクト: pgonzbecer/GDToolkit
        // Gets the maximum value of the size
        public static Size2f max(Size2f value, Size2f max)
        {
            // Variables
            Size2f	temp=	value;

            if(value.width> max.width)
                temp.width=	max.width;
            if(value.height> max.height)
                temp.height=	max.height;

            return temp;
        }
コード例 #6
0
ファイル: Mathx.cs プロジェクト: pgonzbecer/GDToolkit
        // Gets the most minimum size of the two given sizes
        public static Size2f getMostMin(Size2f val1, Size2f val2)
        {
            // Variables
            Size2f	size=	Size2f.NO_SIZE;

            if(val1.width< val2.width)
                size.width=	val1.width;
            else
                size.width=	val2.width;
            if(val1.height< val2.height)
                size.height=	val1.height;
            else
                size.height=	val2.height;

            return size;
        }
コード例 #7
0
ファイル: Mathx.cs プロジェクト: pgonzbecer/GDToolkit
        // Clamps the size to the given min and max bounds
        public static Size2f clamp(Size2f value, Size2f min, Size2f max)
        {
            // Variables
            Size2f	temp=	value;

            if(value.width< min.width)
                temp.width=	min.width;
            else if(value.width> max.width)
                temp.width=	max.width;
            if(value.height< min.height)
                temp.height=	min.height;
            else if(value.height> max.height)
                temp.height=	max.height;

            return temp;
        }
コード例 #8
0
ファイル: Point2f.cs プロジェクト: pgonzbecer/GDToolkit
 // Adds the point with a size to get another point
 public Point2f add(Size2f size)
 {
     return new Point2f(x+size.width, y+size.height);
 }
コード例 #9
0
ファイル: Size2f.cs プロジェクト: pgonzbecer/GDToolkit
 // Finds if the two sizes are equal to each other
 public bool equals(Size2f size)
 {
     return (width== size.width && height== size.height);
 }
コード例 #10
0
ファイル: Size2f.cs プロジェクト: pgonzbecer/GDToolkit
 // Adds the two sizes together
 public Size2f add(Size2f size)
 {
     return new Size2f(width+size.width, height+size.height);
 }
コード例 #11
0
ファイル: Point2i.cs プロジェクト: pgonzbecer/GDToolkit
 // Subtracts the point with a size to get another point
 public Point2i subtract(Size2f size)
 {
     return new Point2i(x-(int)size.width, y-(int)size.height);
 }
コード例 #12
0
ファイル: Point2i.cs プロジェクト: pgonzbecer/GDToolkit
 // Adds the point with a size to get another point
 public Point2i add(Size2f size)
 {
     return new Point2f(x+(int)size.width, y+(int)size.height);
 }
コード例 #13
0
ファイル: Point3f.cs プロジェクト: pgonzbecer/GDToolkit
 // Subtracts the point with a size to get another point
 public Point3f subtract(Size2f size)
 {
     return new Point3f(x-size.width, y-size.height, z);
 }
コード例 #14
0
ファイル: Point3f.cs プロジェクト: pgonzbecer/GDToolkit
 // Adds the point with a size to get another point
 public Point3f add(Size2f size)
 {
     return new Point3f(x+size.width, y+size.height, z);
 }
コード例 #15
0
ファイル: Size2f.cs プロジェクト: pgonzbecer/GDToolkit
 // Subtracts the two sizes together
 public Size2f subtract(Size2f size)
 {
     return new Size2f(width-size.width, height-size.height);
 }
コード例 #16
0
ファイル: Rectangle.cs プロジェクト: pgonzbecer/GDToolkit
 public Rectangle(Point2f pmPos, Size2f pmSize)
 {
     pPos=	pmPos;
     pSize=	pmSize;
     bvolume=	new BVRectangle(pPos, pPos+pSize);
 }
コード例 #17
0
ファイル: Point3i.cs プロジェクト: pgonzbecer/GDToolkit
 // Adds the point with a size to get another point
 public Point3i add(Size2f size)
 {
     return new Point3i(x+(int)size.width, y+(int)size.height, z);
 }