Exemplo n.º 1
0
 /// <summary>
 /// Change edge handling with white border if border is selected
 /// </summary>
 public bool SetEdge(TextureEdge edge)
 {
     return(SetEdge(edge, Color.White));
 }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
 /// <summary>
 /// This functions allows you to change the edge handling after creating the texture.
 /// </summary>
 public bool SetEdge(TextureEdge edge, Color borderColor)
 {
     return(MtaClient.DxSetTextureEdge(materialElement, edge == TextureEdge.MirrorOnce ? "mirror-once" : edge.ToString(), borderColor.Hex));
 }
Exemplo n.º 4
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());
 }