Class Texture2D
- Namespace
- Lime
- Assembly
- Lime.dll
Represents 2D texture
public class Texture2D : CommonTexture, ITexture, IDisposable
- Inheritance
-
Texture2D
- Implements
- Inherited Members
Properties
ImageSize
public Size ImageSize { get; protected set; }
Property Value
IsStubTexture
public bool IsStubTexture { get; }
Property Value
OpacityMask
public OpacityMask OpacityMask { get; }
Property Value
TextureParams
public TextureParams TextureParams { get; set; }
Property Value
UnderlyingTexture
public ITexture UnderlyingTexture { get; }
Property Value
Methods
Dispose()
public override void Dispose()
~Texture2D()
protected ~Texture2D()
GetPixels()
public virtual Color4[] GetPixels()
Returns
- Color4[]
GetPlatformTexture()
public virtual IPlatformTexture2D GetPlatformTexture()
Returns
IsTransparentPixel(int, int)
Checks pixel transparency at given coordinates.
public bool IsTransparentPixel(int x, int y)
Parameters
Returns
LoadImage(Bitmap)
public void LoadImage(Bitmap bitmap)
Parameters
bitmap
Bitmap
LoadImage(Color4[], int, int)
Create texture from pixel array
public void LoadImage(Color4[] pixels, int width, int height)
Parameters
LoadImage(byte[])
public void LoadImage(byte[] data)
Parameters
data
byte[]
LoadImage(Stream)
public void LoadImage(Stream stream)
Parameters
stream
Stream
LoadImage(string, TextureMissingDelegate)
public void LoadImage(string path, Texture2D.TextureMissingDelegate onTextureMissing = null)
Parameters
path
stringonTextureMissing
Texture2D.TextureMissingDelegate
LoadSubImage(Color4[], int, int, int, int)
Load subtexture from pixel array Warning: this method doesn't support automatic texture reload after restoring graphics context
public void LoadSubImage(Color4[] pixels, int x, int y, int width, int height)
Parameters
MaybeDiscardUnderPressure()
public override void MaybeDiscardUnderPressure()
RestoreRenderTarget()
Restores default render target(backbuffer).
public void RestoreRenderTarget()
SetAsRenderTarget()
Sets texture as a render target
public void SetAsRenderTarget()
TransformUVCoordinatesToAtlasSpace(ref Vector2)
public void TransformUVCoordinatesToAtlasSpace(ref Vector2 uv)
Parameters
uv
Vector2
TryLocateTextureInCurrentBundle(string, out string)
public static bool TryLocateTextureInCurrentBundle(string pathWithoutExtension, out string completePath)