MaterialContent.SetTexture Method

Sets a value in the contained TextureReferenceDictionary object.

If null is passed, the value is removed.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

protected void SetTexture (
         string key,
         ExternalReference<TextureContent> value


Name of the key being modified.
Value being set.

The key value differs depending on the type of attached dictionary.

If attached to a BasicMaterialContent dictionary (which becomes a BasicEffect object at run time), the value for the Texture key is used as the texture for the BasicEffect runtime object. Other keys are ignored.

If attached to a EffectMaterialContent dictionary, key names are the texture names used by the effect. These names are dependent upon the author of the effect object.

Build content in XNA Game Studio for Windows Phone 7, Xbox 360, Windows 7, Windows Vista, and Windows XP.