Sets the texture object's image or color. Always returns 1, regardless if the texture was set successfully. Prior to patch 4.0, it would return nil if the texture was not set successfully (i.e. an invalid path). After patch 4.0, it was still possible to validate by immediately calling :GetTexture(), but as of WoW 5.0.4, this is no longer possible, as :GetTexture() will return the path even if it is not valid.

Signature:

visible = Texture:SetTexture("texture") or Texture:SetTexture(red, green, blue [, alpha])

Arguments:

  • texture - Path to a texture image (string)
  • red - Red component of the color (0.0 - 1.0) (number)
  • green - Green component of the color (0.0 - 1.0) (number)
  • blue - Blue component of the color (0.0 - 1.0) (number)
  • alpha - Alpha (opacity) for the color (0.0 = fully transparent, 1.0 = fully opaque) (number)

Returns:

  • visible - Always returns 1 regardless of success or failure. (1nil)