ES3.LoadImage

public static Texture2D LoadImage(string imagePath, ES3Settings settings)

Description

Loads a JPG or PNG image file as a Texture2D.

A FileNotFoundException will be thrown if the file does not exist. In this case, you can use ES3.FileExists to check if the data exists before loading.

An ArgumentException will be thrown if the file extension is not jpgjpeg, or png.

Parameters

imagePath The relative or absolute path of the JPG or PNG image file we want to load.

settings

[Optional] The settings we want to use to override the default settings.

Returns

The loaded Texture2D.

Examples

C#

JS

public static Texture2D LoadImage(byte[] bytes)

Description

Loads the bytes of a JPG or PNG image file as a Texture2D.

Parameters

bytes The bytes representing our JPG or PNG.

Returns

The loaded Texture2D.

Examples

C#

JS