Table of Contents

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

Size

IsStubTexture

public bool IsStubTexture { get; }

Property Value

bool

OpacityMask

public OpacityMask OpacityMask { get; }

Property Value

OpacityMask

TextureParams

public TextureParams TextureParams { get; set; }

Property Value

TextureParams

UnderlyingTexture

public ITexture UnderlyingTexture { get; }

Property Value

ITexture

Methods

Dispose()

public override void Dispose()

~Texture2D()

protected ~Texture2D()

GetPixels()

public virtual Color4[] GetPixels()

Returns

Color4[]

GetPlatformTexture()

public virtual IPlatformTexture2D GetPlatformTexture()

Returns

IPlatformTexture2D

IsTransparentPixel(int, int)

Checks pixel transparency at given coordinates.

public bool IsTransparentPixel(int x, int y)

Parameters

x int

x-coordinate of pixel.

y int

y-coordinate of pixel.

Returns

bool

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

pixels Color4[]
width int
height int

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 string
onTextureMissing 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

pixels Color4[]
x int
y int
width int
height int

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)

Parameters

pathWithoutExtension string
completePath string

Returns

bool