My Project
|
Public Types | |
enum | CommonColorEnum { White = 0 , Black , Blue , Green , Red , LightYellow } |
Public Member Functions | |
void | SetRecordSettings (bool autoAspect, int width, int height, float duration, int fps, int loop, int quality) |
(Settings-1) Sets the recording settings before StartRecord | |
void | SetRecordSettings (Vector2 aspectRatio, int width, int height, float duration, int fps, int loop, int quality) |
(Settings-2) Sets the recording settings before StartRecord | |
void | StartRecord (Action< float > onRecordProgress=null, Action onRecordDurationMax=null, bool autoClear=true) |
Starts the recorder to store frames with Camera.main. (For changing recorder settings, you can use the SetRecordSettings method before calling StartRecord) | |
void | StartRecord (Camera camera, Action< float > onRecordProgress=null, Action onRecordDurationMax=null, bool autoClear=true) |
Starts the recorder to store frames with specific camera. (For changing recorder settings, you can use the SetRecordSettings method before calling StartRecord) | |
void | SetGifRotation (ImageRotator.Rotation rotation) |
Sets the GIF rotation. | |
void | SetTransparent (Color32 color32, byte transparentColorRange) |
Sets the transparent color, hide this color in the GIF. The GIF specification allows setting a color to be transparent. *** Use case: if you want to record gameObject, character or anything else with transparent background, please make sure the background is of solid color(no gradient), and the target object do not contain this color. (Also be reminded, the transparent feature takes more time to encoding the GIF) | |
void | SetTransparent (bool autoDetectTransparent) |
Auto detects the input image(s) pixels for enable/disable transparent feature. *** Use case: for pre-made images that have transparent pixels manually set. (Also be reminded, the transparent feature takes more time to encoding the GIF) | |
void | PauseRecord () |
Pauses the recorder. | |
void | ResumeRecord () |
Resume the recorder. | |
void | StopRecord () |
Stops the recorder. | |
void | SaveRecord (Action onRecorderPreProcessingDone=null, Action< int, float > onFileSaveProgress=null, Action< int, string > onFileSaved=null, string fileNameWithoutExtension="") |
Saves the stored frames to a gif file. | |
void | StopAndSaveRecord (Action onRecorderPreProcessingDone=null, Action< int, float > onFileSaveProgress=null, Action< int, string > onFileSaved=null, string fileNameWithoutExtension="") |
Stops the recorder and saves the stored frames to a gif file. | |
void | SetPlayerOptimization (bool enable) |
void | PlayGif (Image playerImage, Action< float > onLoading=null) |
Play gif from Recorder, display with Image. | |
void | PlayGif (Renderer playerRenderer, Action< float > onLoading=null) |
Play gif from Recorder, display with Renderer. | |
void | PlayGif (RawImage playerRawImage, Action< float > onLoading=null) |
Play gif from Recorder, display with RawImage. | |
void | SetPlayerOnLoading (Action< float > onLoading) |
Set the callback for checking the decode progress. If using a recorder source for playback, this becomes a loading-complete callback. | |
void | SetPlayerOnFirstFrame (Action< ProGifPlayerComponent.FirstGifFrame > onFirstFrame) |
Set the callback to be fired when the first gif frame ready. If using a recorder source for playback, this becomes a loading-complete callback with the first GIF frame returned. | |
void | SetPlayerOnPlaying (Action< GifTexture > onPlaying) |
Set the callback to be fired on every frame when playing gif. | |
void | PausePlayer () |
void | ResumePlayer () |
void | StopPlayer () |
void | ShareTwitter (string filePath) |
Twitter share example. | |
void | ShareTwitter_Mobile (string filePath) |
Twitter mobile share example. | |
void | ShareFacebook (string filePath="") |
Facebook share example. | |
void | Clear () |
void | ClearRecorder () |
void | ClearRecorder_Delay (Action onClear=null) |
Delay clear the target recorder by monitoring both the recorder and the player status, this ensures the recorder textures not being cleared too early. | |
void | ClearPlayer () |
Static Public Member Functions | |
static T | InstantiatePrefab< T > (GameObject prefab) |
static Color | GetColor (CommonColorEnum colorEnum) |
Public Attributes | |
string | m_GiphyUserName = "" |
string | m_GiphyApiKey = "" |
string | m_GiphyUploadApiKey = "" |
ProGifRecorder | m_GifRecorder = null |
ProGifPlayer | m_GifPlayer = null |
string | m_CurrentGifPath = "" |
Vector2 | m_AspectRatio = new Vector2(0, 0) |
bool | m_AutoAspect = true |
int | m_Width = 360 |
int | m_Height = 360 |
float | m_Duration = 3f |
int | m_Fps = 15 |
int | m_Loop = 0 |
int | m_Quality = 20 |
ImageRotator.Rotation | m_Rotation = ImageRotator.Rotation.None |
Color32 | m_TransparentColor = new Color32(0, 0, 0, 0) |
byte | m_TransparentColorRange = 0 |
bool | m_AutoTransparent = false |
bool | m_OptimizeMemoryUsage = true |
Set to 'true' to take advantage of the highly optimized ProGif playback solution for significantly save the memory usage. | |
Static Public Attributes | |
static string | PP_LastGifPathKey = "ProGIF_LastGifPathKey" |
Properties | |
static ProGifManager | Instance [get] |
Gets the instance of ProGifManager. Create new one if no existing instance. Use this instance to control gif Record, Playback and Settings. | |
|
inline |
Delay clear the target recorder by monitoring both the recorder and the player status, this ensures the recorder textures not being cleared too early.
onClear | The callback to be fired when the recorder actually being cleared. (Optional) |
|
inlinestatic |
T | : | MonoBehaviour |
|
inline |
Play gif from Recorder, display with Image.
playerImage | Target image for displaying gif. |
onLoading | On loading. Return value: loading progress(float) |
|
inline |
Play gif from Recorder, display with RawImage.
playerRawImage | Target RawImage for displaying gif. |
onLoading | On loading. Return value: loading progress(float) |
|
inline |
Play gif from Recorder, display with Renderer.
playerRenderer | Target renderer for displaying gif. |
onLoading | On loading. Return value: loading progress(float) |
|
inline |
Saves the stored frames to a gif file.
onRecorderPreProcessingDone | On recorder pre processing done. |
onFileSaveProgress | On file save progress. Retrun values: worker id(int), save progress(float). |
onFileSaved | On file saved. Return values: id(int), saved path(string). |
|
inline |
Sets the GIF rotation.
rotation | Rotation: None, -90, 90, 180 |
|
inline |
Set the callback to be fired when the first gif frame ready. If using a recorder source for playback, this becomes a loading-complete callback with the first GIF frame returned.
onFirstFrame | On first frame callback, returns the first gifTexture and related data. |
|
inline |
Set the callback for checking the decode progress. If using a recorder source for playback, this becomes a loading-complete callback.
onLoading | On loading callback, returns the decode progress(float). |
|
inline |
Set the callback to be fired on every frame when playing gif.
onPlaying | On gif playing callback, returns the current gifTexture. |
|
inline |
Set Enable or Disable for optimizing memory usage for gif players. (Call this method before playing GIF)
|
inline |
(Settings-1) Sets the recording settings before StartRecord
autoAspect | If set to true, auto aspect. Else force scale gif size to width*height. |
width | Width. |
height | Height. If autoAspect, height will be recalculated. |
duration | Total time to record. |
fps | Frames per second. |
loop | Loop. -1: no repeat, 0: infinite, >0: repeat count |
quality | Quality. (1 - 100), 1: best, 100: faster |
|
inline |
(Settings-2) Sets the recording settings before StartRecord
aspectRatio | A Specify aspect ratio for cropping gif. Set (0,0) if dont use, or use Settings-1 instead. |
width | Width. |
height | Height. If autoAspect, height will be recalculated. |
duration | Total time to record. |
fps | Frames per second. |
loop | Loop. -1: no repeat, 0: infinite, >0: repeat count |
quality | Quality. (1 - 100), 1: best, 100: faster |
|
inline |
Auto detects the input image(s) pixels for enable/disable transparent feature. *** Use case: for pre-made images that have transparent pixels manually set. (Also be reminded, the transparent feature takes more time to encoding the GIF)
autoDetectTransparent | If set to true auto detect transparent pixels to enable the transparent feature, else disable the auto detection. |
|
inline |
Sets the transparent color, hide this color in the GIF. The GIF specification allows setting a color to be transparent. *** Use case: if you want to record gameObject, character or anything else with transparent background, please make sure the background is of solid color(no gradient), and the target object do not contain this color. (Also be reminded, the transparent feature takes more time to encoding the GIF)
color32 | The Color to hide in the gif. Make sure the alpha value greater than Zero, else disable the transparent feature. |
transparentColorRange | The range of RGB value for picking nearby colors of the input color to set as transparent pixels. |
|
inline |
Facebook share example.
filePath | File path. |
|
inline |
Twitter share example.
filePath | File path. |
|
inline |
Twitter mobile share example.
filePath | File path. |
|
inline |
Starts the recorder to store frames with Camera.main. (For changing recorder settings, you can use the SetRecordSettings method before calling StartRecord)
onRecordProgress | Update the record progress. Return values: record progress(float) |
onRecordDurationMax | To be fired when target duration frames reached. |
autoClear | If set to true , clear the recorder when gif saved. (Do Not auto clear the recorder if you want to preview the GIF) |
|
inline |
Starts the recorder to store frames with specific camera. (For changing recorder settings, you can use the SetRecordSettings method before calling StartRecord)
camera | Target Camera for recording gif |
onRecordProgress | Update the record progress. Return values: record progress(float) |
onRecordDurationMax | To be fired when target duration frames reached. |
autoClear | If set to true Clear the recorder when gif saved? (Do Not auto clear the recorder if you want to preview the GIF) |
|
inline |
Stops the recorder and saves the stored frames to a gif file.
onRecorderPreProcessingDone | On recorder pre processing done. |
onFileSaveProgress | On file save progress. Retrun values: worker id(int), save progress(float). |
onFileSaved | On file saved. Return values: id(int), saved path(string). |
|
staticget |
Gets the instance of ProGifManager. Create new one if no existing instance. Use this instance to control gif Record, Playback and Settings.
The instance.