Table of Contents

Interface ITextureLoader

Namespace
BSGameLib.Game.Textures
Assembly
BSGameLib.Game.dll

Loads textures from files and streams.

public interface ITextureLoader

Methods

CreateFromColorArray(Color[], int, int, Color?)

Creates a texture from colors, width pixels wide and height pixels high, making every pixel equal to colorKey transparent when it is given.

ITexture CreateFromColorArray(Color[] colors, int width, int height, Color? colorKey = null)

Parameters

colors Color[]
width int
height int
colorKey Color?

Returns

ITexture

Load(Stream)

Loads a texture from stream, with no colour key.

ITexture Load(Stream stream)

Parameters

stream Stream

Returns

ITexture

Load(Stream, Color?)

Loads a texture from stream, making every pixel equal to colorKey transparent when it is given.

ITexture Load(Stream stream, Color? colorKey)

Parameters

stream Stream
colorKey Color?

Returns

ITexture

Load(string)

Loads the texture in fileName, with no colour key.

ITexture Load(string fileName)

Parameters

fileName string

Returns

ITexture

Load(string, Color?)

Loads a texture, making every pixel exactly equal to colorKey fully transparent.

ITexture Load(string fileName, Color? colorKey)

Parameters

fileName string
colorKey Color?

Returns

ITexture

Remarks

Exact match, deliberately - no tolerance. This mirrors DirectDraw's SetColorKey with low == high, which is what these assets were authored against. Measured across the Odyssey sprite sheets, the art contains no near-black at all (nothing with every channel at or below 24 that isn't already pure black), so a tolerance would buy nothing and could only start eating real color.