Class Texture2D
Assembly: UnityEngine.dll
Syntax
public sealed class Texture2D : Texture
Constructors
|
Improve this Doc
View Source
Texture2D(Int32, Int32)
Declaration
public Texture2D(int width, int height)
Parameters
|
Improve this Doc
View Source
Texture2D(Int32, Int32, GraphicsFormat, TextureCreationFlags)
Declaration
public Texture2D(int width, int height, GraphicsFormat format, TextureCreationFlags flags)
Parameters
|
Improve this Doc
View Source
Texture2D(Int32, Int32, TextureFormat, Boolean)
Declaration
public Texture2D(int width, int height, TextureFormat textureFormat, bool mipChain)
Parameters
|
Improve this Doc
View Source
Texture2D(Int32, Int32, TextureFormat, Boolean, Boolean)
Declaration
public Texture2D(int width, int height, [DefaultValue("TextureFormat.RGBA32")] TextureFormat textureFormat, [DefaultValue("true")] bool mipChain, [DefaultValue("false")] bool linear)
Parameters
Properties
alphaIsTransparency
Declaration
public bool alphaIsTransparency { get; set; }
Property Value
blackTexture
Declaration
public static Texture2D blackTexture { get; }
Property Value
desiredMipmapLevel
Declaration
public int desiredMipmapLevel { get; }
Property Value
format
Declaration
public TextureFormat format { get; }
Property Value
isReadable
Declaration
public override bool isReadable { get; }
Property Value
Overrides
loadedMipmapLevel
Declaration
public int loadedMipmapLevel { get; }
Property Value
loadingMipmapLevel
Declaration
public int loadingMipmapLevel { get; }
Property Value
mipmapCount
Declaration
public int mipmapCount { get; }
Property Value
requestedMipmapLevel
Declaration
public int requestedMipmapLevel { get; set; }
Property Value
streamingMipmaps
Declaration
public bool streamingMipmaps { get; }
Property Value
streamingMipmapsPriority
Declaration
public int streamingMipmapsPriority { get; }
Property Value
whiteTexture
Declaration
public static Texture2D whiteTexture { get; }
Property Value
Methods
|
Improve this Doc
View Source
Apply()
Declaration
|
Improve this Doc
View Source
Apply(Boolean)
Declaration
public void Apply(bool updateMipmaps)
Parameters
Type |
Name |
Description |
Boolean |
updateMipmaps |
|
|
Improve this Doc
View Source
Apply(Boolean, Boolean)
Declaration
public void Apply([DefaultValue("true")] bool updateMipmaps, [DefaultValue("false")] bool makeNoLongerReadable)
Parameters
Type |
Name |
Description |
Boolean |
updateMipmaps |
|
Boolean |
makeNoLongerReadable |
|
ClearRequestedMipmapLevel()
Declaration
public void ClearRequestedMipmapLevel()
Compress(Boolean)
Declaration
public void Compress(bool highQuality)
Parameters
Type |
Name |
Description |
Boolean |
highQuality |
|
|
Improve this Doc
View Source
CreateExternalTexture(Int32, Int32, TextureFormat, Boolean, Boolean, IntPtr)
Declaration
public static Texture2D CreateExternalTexture(int width, int height, TextureFormat format, bool mipChain, bool linear, IntPtr nativeTex)
Parameters
Returns
|
Improve this Doc
View Source
GenerateAtlas(Vector2[], Int32, Int32, List<Rect>)
Declaration
public static bool GenerateAtlas(Vector2[] sizes, int padding, int atlasSize, List<Rect> results)
Parameters
Returns
|
Improve this Doc
View Source
GetPixel(Int32, Int32)
Declaration
public Color GetPixel(int x, int y)
Parameters
Returns
|
Improve this Doc
View Source
GetPixelBilinear(Single, Single)
Declaration
public Color GetPixelBilinear(float x, float y)
Parameters
Returns
|
Improve this Doc
View Source
GetPixels()
Declaration
public Color[] GetPixels()
Returns
|
Improve this Doc
View Source
GetPixels(Int32)
Declaration
public Color[] GetPixels(int miplevel)
Parameters
Type |
Name |
Description |
Int32 |
miplevel |
|
Returns
|
Improve this Doc
View Source
GetPixels(Int32, Int32, Int32, Int32)
Declaration
public Color[] GetPixels(int x, int y, int blockWidth, int blockHeight)
Parameters
Returns
GetPixels(Int32, Int32, Int32, Int32, Int32)
Declaration
public Color[] GetPixels(int x, int y, int blockWidth, int blockHeight, int miplevel)
Parameters
Returns
|
Improve this Doc
View Source
GetPixels32()
Declaration
public Color32[] GetPixels32()
Returns
GetPixels32(Int32)
Declaration
public Color32[] GetPixels32(int miplevel)
Parameters
Type |
Name |
Description |
Int32 |
miplevel |
|
Returns
GetRawTextureData()
Declaration
public byte[] GetRawTextureData()
Returns
|
Improve this Doc
View Source
GetRawTextureData<T>()
Declaration
public NativeArray<T> GetRawTextureData<T>()
where T : struct
Returns
Type Parameters
IsRequestedMipmapLevelLoaded()
Declaration
public bool IsRequestedMipmapLevelLoaded()
Returns
|
Improve this Doc
View Source
LoadRawTextureData(Byte[])
Declaration
public void LoadRawTextureData(byte[] data)
Parameters
Type |
Name |
Description |
Byte[] |
data |
|
|
Improve this Doc
View Source
LoadRawTextureData(IntPtr, Int32)
Declaration
public void LoadRawTextureData(IntPtr data, int size)
Parameters
|
Improve this Doc
View Source
LoadRawTextureData<T>(NativeArray<T>)
Declaration
public void LoadRawTextureData<T>(NativeArray<T> data)
where T : struct
Parameters
Type Parameters
|
Improve this Doc
View Source
PackTextures(Texture2D[], Int32)
Declaration
public Rect[] PackTextures(Texture2D[] textures, int padding)
Parameters
Returns
|
Improve this Doc
View Source
PackTextures(Texture2D[], Int32, Int32)
Declaration
public Rect[] PackTextures(Texture2D[] textures, int padding, int maximumAtlasSize)
Parameters
Returns
PackTextures(Texture2D[], Int32, Int32, Boolean)
Declaration
public Rect[] PackTextures(Texture2D[] textures, int padding, int maximumAtlasSize, bool makeNoLongerReadable)
Parameters
Returns
|
Improve this Doc
View Source
ReadPixels(Rect, Int32, Int32)
Declaration
[ExcludeFromDocs]
public void ReadPixels(Rect source, int destX, int destY)
Parameters
|
Improve this Doc
View Source
ReadPixels(Rect, Int32, Int32, Boolean)
Declaration
public void ReadPixels(Rect source, int destX, int destY, [DefaultValue("true")] bool recalculateMipMaps)
Parameters
|
Improve this Doc
View Source
Resize(Int32, Int32)
Declaration
public bool Resize(int width, int height)
Parameters
Returns
|
Improve this Doc
View Source
Resize(Int32, Int32, TextureFormat, Boolean)
Declaration
public bool Resize(int width, int height, TextureFormat format, bool hasMipMap)
Parameters
Returns
|
Improve this Doc
View Source
SetPixel(Int32, Int32, Color)
Declaration
public void SetPixel(int x, int y, Color color)
Parameters
|
Improve this Doc
View Source
SetPixels(Int32, Int32, Int32, Int32, Color[])
Declaration
public void SetPixels(int x, int y, int blockWidth, int blockHeight, Color[] colors)
Parameters
|
Improve this Doc
View Source
SetPixels(Int32, Int32, Int32, Int32, Color[], Int32)
Declaration
public void SetPixels(int x, int y, int blockWidth, int blockHeight, Color[] colors, [DefaultValue("0")] int miplevel)
Parameters
|
Improve this Doc
View Source
SetPixels(Color[])
Declaration
public void SetPixels(Color[] colors)
Parameters
Type |
Name |
Description |
Color[] |
colors |
|
|
Improve this Doc
View Source
SetPixels(Color[], Int32)
Declaration
public void SetPixels(Color[] colors, [DefaultValue("0")] int miplevel)
Parameters
Type |
Name |
Description |
Color[] |
colors |
|
Int32 |
miplevel |
|
|
Improve this Doc
View Source
SetPixels32(Int32, Int32, Int32, Int32, Color32[])
Declaration
public void SetPixels32(int x, int y, int blockWidth, int blockHeight, Color32[] colors)
Parameters
|
Improve this Doc
View Source
SetPixels32(Int32, Int32, Int32, Int32, Color32[], Int32)
Declaration
public void SetPixels32(int x, int y, int blockWidth, int blockHeight, Color32[] colors, int miplevel)
Parameters
|
Improve this Doc
View Source
SetPixels32(Color32[])
Declaration
public void SetPixels32(Color32[] colors)
Parameters
Type |
Name |
Description |
Color32[] |
colors |
|
|
Improve this Doc
View Source
SetPixels32(Color32[], Int32)
Declaration
public void SetPixels32(Color32[] colors, int miplevel)
Parameters
UpdateExternalTexture(IntPtr)
Declaration
public void UpdateExternalTexture(IntPtr nativeTex)
Parameters
Type |
Name |
Description |
IntPtr |
nativeTex |
|
Extension Methods