コード例 #1
0
ファイル: Textures.cs プロジェクト: jpires/gta2net
        /// <summary>
        /// Gets the coordinates for the texture acording to its rotation and flip.
        /// </summary>
        /// <remarks>The return values are stored 0->BottonLeft; 1->BottonRight; 2->TopRight; 3->TopLeft</remarks>
        /// <param name="tileID">The ID of the texture.</param>
        /// <param name="rotation">The rotation to aply to the texture.</param>
        /// <param name="flip">If the Texture must be fliped.</param>
        /// <param name="position">The position of the texture inside the 64px texture.</param>
        /// <returns>A array with 4 positions where each position represent one of the vertices od the texture, it will be a square with 24px.</returns>
        public Vector2[] GetLittleTexture(UInt32 tileID, RotationType rotation, Boolean flip, SquareTexturePosition position)
        {
            Vector2[] texture = GetNormalTexture(tileID, rotation, flip);
            Vector2[] newTexture = new Vector2[4];

            switch (position){
                case SquareTexturePosition.BottonLeft:
                    newTexture = bottomLeft(texture, rotation, flip);
                    break;
            }

            return newTexture;
        }
コード例 #2
0
ファイル: Textures.cs プロジェクト: spritefun/gta2net
        /// <summary>
        /// Gets the coordinates for the texture acording to its rotation and flip.
        /// </summary>
        /// <remarks>The return values are stored 0->BottonLeft; 1->BottonRight; 2->TopRight; 3->TopLeft</remarks>
        /// <param name="tileID">The ID of the texture.</param>
        /// <param name="rotation">The rotation to aply to the texture.</param>
        /// <param name="flip">If the Texture must be fliped.</param>
        /// <param name="position">The position of the texture inside the 64px texture.</param>
        /// <returns>A array with 4 positions where each position represent one of the vertices od the texture, it will be a square with 24px.</returns>
        public Vector2[] GetLittleTexture(UInt32 tileID, RotationType rotation, Boolean flip, SquareTexturePosition position)
        {
            Vector2[] texture    = GetNormalTexture(tileID, rotation, flip);
            Vector2[] newTexture = new Vector2[4];

            switch (position)
            {
            case SquareTexturePosition.BottonLeft:
                newTexture = bottomLeft(texture, rotation, flip);
                break;
            }

            return(newTexture);
        }