Class Gif
Inheritance
Namespace: EasyMobile
Assembly: cs.temp.dll.dll
Syntax
public class Gif : MonoBehaviour
Properties
Instance
Declaration
public static Gif Instance { get; }
Property Value
Type | Description |
---|---|
Gif |
Methods
DecodeGif(String, Int32, ThreadPriority, Action<AnimatedClip>)
Decodes the GIF file at the provided filepath into an AnimatedClip object. If framesToRead is smaller than 1 or bigger than the total number of frames in the GIF, the whole file will be read. Otherwise, only the number of frames determined by framesToRead will be decoded.
Declaration
public static void DecodeGif(string filepath, int framesToRead, ThreadPriority threadPriority, Action<AnimatedClip> completeCallback)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | |
System.Int32 | framesToRead | |
System.Threading.ThreadPriority | threadPriority | |
System.Action<AnimatedClip> | completeCallback |
DecodeGif(String, Int32, ThreadPriority, Action<Texture[]>)
Decodes the GIF file at the provided filepath into an array to textures. If framesToRead is smaller than 1 or bigger than the total number of frames in the GIF, the whole file will be read. Otherwise, only the number of frames determined by framesToRead will be decoded.
Declaration
public static void DecodeGif(string filepath, int framesToRead, ThreadPriority threadPriority, Action<Texture[]> completeCallback)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | |
System.Int32 | framesToRead | |
System.Threading.ThreadPriority | threadPriority | |
System.Action<Texture[]> | completeCallback |
DecodeGif(String, ThreadPriority, Action<AnimatedClip>)
Decodes the GIF file at the provided filepath into an AnimatedClip object.
Declaration
public static void DecodeGif(string filepath, ThreadPriority threadPriority, Action<AnimatedClip> completeCallback)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | |
System.Threading.ThreadPriority | threadPriority | |
System.Action<AnimatedClip> | completeCallback |
ExportGif(AnimatedClip, String, Int32, Int32, ThreadPriority, Action<AnimatedClip, Single>, Action<AnimatedClip, String>)
Exports a GIF image from the provided clip. Allows setting looping mode of the output image.
Declaration
public static void ExportGif(AnimatedClip clip, string filename, int loop, int quality, ThreadPriority threadPriority, Action<AnimatedClip, float> exportProgressCallback, Action<AnimatedClip, string> exportCompletedCallback)
Parameters
Type | Name | Description |
---|---|---|
AnimatedClip | clip | The clip to export to GIF format. |
System.String | filename | Filename to save the output GIF. |
System.Int32 | loop | -1 to disable, 0 to loop indefinitely, >0 to loop a set number of times. |
System.Int32 | quality | Quality setting for the exported image. Inputs will be clamped between 1 and 100. Bigger values mean better quality but slightly longer processing time. 80 is generally a good value in terms of time-quality balance. |
System.Threading.ThreadPriority | threadPriority | Priority of the GIF encoding thread. |
System.Action<AnimatedClip, System.Single> | exportProgressCallback | Export progress callback: 1st parameter is the provided clip, 2nd parameter is the export progress from 0 to 1. |
System.Action<AnimatedClip, System.String> | exportCompletedCallback | Export completed callback: 1st parameter is the provided clip, 2nd parameter is the filepath of the exported GIF. |
ExportGif(AnimatedClip, String, Int32, ThreadPriority, Action<AnimatedClip, Single>, Action<AnimatedClip, String>)
Exports a GIF image from the provided clip.
Declaration
public static void ExportGif(AnimatedClip clip, string filename, int quality, ThreadPriority threadPriority, Action<AnimatedClip, float> exportProgressCallback, Action<AnimatedClip, string> exportCompletedCallback)
Parameters
Type | Name | Description |
---|---|---|
AnimatedClip | clip | The clip to export to GIF format. |
System.String | filename | Filename to save the output GIF. |
System.Int32 | quality | Quality setting for the exported image. Inputs will be clamped between 1 and 100. Bigger values mean better quality but slightly longer processing time. 80 is generally a good value in terms of time-quality balance. |
System.Threading.ThreadPriority | threadPriority | Thread priority to use when exporting GIF file. |
System.Action<AnimatedClip, System.Single> | exportProgressCallback | Export progress callback: 1st parameter is the provided clip, 2nd parameter is the export progress from 0 to 1. |
System.Action<AnimatedClip, System.String> | exportCompletedCallback | Export completed callback: 1st parameter is the provided clip, 2nd parameter is the filepath of the exported GIF. |
IsRecording(Recorder)
Determines whether the recorder is recording.
Declaration
public static bool IsRecording(Recorder recorder)
Parameters
Type | Name | Description |
---|---|---|
Recorder | recorder | Recorder. |
Returns
Type | Description |
---|---|
System.Boolean |
|
PausePlayer(IClipPlayer)
Pauses the clip player.
Declaration
public static void PausePlayer(IClipPlayer player)
Parameters
Type | Name | Description |
---|---|---|
IClipPlayer | player | Player. |
PlayClip(IClipPlayer, AnimatedClip, Single, Boolean)
Plays the clip on the specified clip player.
Declaration
public static void PlayClip(IClipPlayer player, AnimatedClip clip, float startDelay = 0F, bool loop = true)
Parameters
Type | Name | Description |
---|---|---|
IClipPlayer | player | Player. |
AnimatedClip | clip | Clip. |
System.Single | startDelay | Optional delay before the playing starts. |
System.Boolean | loop | If set to |
ResumePlayer(IClipPlayer)
Resumes playing on the clip player.
Declaration
public static void ResumePlayer(IClipPlayer player)
Parameters
Type | Name | Description |
---|---|---|
IClipPlayer | player | Player. |
StartRecording(Recorder)
Starts recording on the specified recorder.
Declaration
public static void StartRecording(Recorder recorder)
Parameters
Type | Name | Description |
---|---|---|
Recorder | recorder | Recorder. |
StopPlayer(IClipPlayer)
Stops the clip player.
Declaration
public static void StopPlayer(IClipPlayer player)
Parameters
Type | Name | Description |
---|---|---|
IClipPlayer | player | Player. |
StopRecording(Recorder)
Stops recording on the specified recorder.
Declaration
public static AnimatedClip StopRecording(Recorder recorder)
Parameters
Type | Name | Description |
---|---|---|
Recorder | recorder | Recorder. |
Returns
Type | Description |
---|---|
AnimatedClip | The recorded clip. |