Пример #1
0
        /// <summary>
        /// Create an empty texture
        /// </summary>
        public Texture(Vector2 dimensions, TextureFormat textureFormat = TextureFormat.Argb, TextureEdge textureEdge = TextureEdge.Wrap, TextureType textureType = TextureType.TwoDimensional, int depth = 1)
        {
            string textureTypeString = "cube";

            if (textureType == TextureType.TwoDimensional)
            {
                textureTypeString = "2d";
            }
            else if (textureType == TextureType.ThreeDimensional)
            {
                textureTypeString = "3d";
            }

            materialElement = MtaClient.DxCreateTexture((int)dimensions.X, (int)dimensions.Y, textureFormat.ToString().ToLower(), textureEdge.ToString().ToLower(), textureTypeString, depth);
        }
Пример #2
0
 /// <summary>
 /// Create a texture element from a file or raw image string
 /// </summary>
 public Texture(string filePathOrPixels, TextureFormat textureFormat = TextureFormat.Argb, bool mipmaps = true, TextureEdge textureEdge = TextureEdge.Wrap)
 {
     materialElement = MtaClient.DxCreateTexture(filePathOrPixels, textureFormat.ToString().ToLower(), mipmaps, textureEdge.ToString().ToLower());
 }