This is the main interface to the Megacool SDK. Call Start()
as early as possible during application startup.
More...
|
Action | CompletedSharing |
| Callback when a user has completed a share. On Android this is only available for API level 22+. More...
|
|
Action | DismissedSharing |
| Callback when a user has aborted (dismissed) a share. On Android this is only available for API level 22+. More...
|
|
Action | PossiblyCompletedSharing |
| Callback when a user either aborted or completed a share, but we can't know which. More...
|
|
This is the main interface to the Megacool SDK. Call Start()
as early as possible during application startup.
◆ GifColorTableType
How the colors in the GIF should be computed.
Enumerator |
---|
GifColorTableFixed | A fixed set of colors is used. This is very fast, but sacrifices quality for nuanced colors and gradients.
|
GifColorTableAnalyzeFirst | Analyze the frames first. This algorithm is largely equivalent to dynamic, but uses a bit more memory. Which is faster depends on workload.
This is only available on iOS, on Android this is the same as dynamic.
|
GifColorTableDynamic | A subset of the frames is analyzed first. This is the default and yields a good balance between quality and speed.
|
◆ CaptureFrame() [1/2]
void Megacool.CaptureFrame |
( |
| ) |
|
|
inline |
◆ CaptureFrame() [2/2]
Capture a single frame.
If the recording doesn't already exist it'll be created with the settings specified in the config.
◆ DeleteRecording()
void Megacool.DeleteRecording |
( |
string |
recordingId | ) |
|
|
inline |
Delete a recording
Will remove any frames of the recording in memory and on disk. Both completed and incomplete recordings will take space on disk, thus particularly if you're using KeepCompletedRecordings = true
you might want to provide an interface to your users for removing recordings they don't care about anymore to free up space for new recordings.
- Parameters
-
recordingId | Recording identifier. |
◆ DeleteShares()
Deletes local shares.
Use this to clear old shares from local storage. The filter will be passed each share available locally, return true for the given share to be deleted.
- Parameters
-
◆ GetNumberOfFrames()
int Megacool.GetNumberOfFrames |
( |
string |
recordingId | ) |
|
|
inline |
Gets the number of frames available in a given recording.
Use this to check that a recording has a frames available before showing a preview.
- Returns
- The number of frames.
- Parameters
-
recordingId | Which recording to get the frame count of |
◆ GetShares()
Get the state of shares sent.
Use this if a user is wondering whether someone has clicked, installed or been re-engaged from the shares sent.
This will also cause the SDK to check for new events, so you might receive MegacoolSentShareOpened events after calling this.
- Parameters
-
shares | Callback to receive the updated shares |
◆ PauseRecording()
void Megacool.PauseRecording |
( |
| ) |
|
|
inline |
Pauses the recording.
This does nothing if there's no recording currently in progress.
◆ RegisterScoreChange() [1/2]
void Megacool.RegisterScoreChange |
( |
| ) |
|
|
inline |
Note an event for highlight recording.
For highlight recording use only. Call this function when something interesting occurs, like a point is scored or a coin collected or the player hits an opponent. The section of the recording with the highest amount of calls to this function will be what is present in the final recording, with the peak located at located at Megacool.PeakLocation.
◆ RegisterScoreChange() [2/2]
void Megacool.RegisterScoreChange |
( |
int |
scoreDelta | ) |
|
|
inline |
Note a change in score for highlight recording
For highlight recording use only. Call this function when something interesting occurs, like a point is scored or a coin collected or the player hits an opponent. The section of the recording with the highest absolute sum of deltas sent to this function will be what is present in the final recording, with the peak located at located at Megacool.PeakLocation.
◆ ResetIdentity()
void Megacool.ResetIdentity |
( |
| ) |
|
|
inline |
Resets the device identity.
This is a test or debugging tool to make the current device appear as if it's a new device, making it possible to test referrals and link clicks from a "new" device.
Must be called before Start().
◆ Share() [1/2]
Share the default recording.
◆ Share() [2/2]
Share a recording according to the config.
- Parameters
-
◆ ShareToMail() [1/2]
void Megacool.ShareToMail |
( |
| ) |
|
|
inline |
Share directly to email with custom config.
- Parameters
-
◆ ShareToMail() [2/2]
Share directly to email with custom config.
- Parameters
-
◆ ShareToMessages() [1/2]
void Megacool.ShareToMessages |
( |
| ) |
|
|
inline |
Share directly to SMS.
- Parameters
-
◆ ShareToMessages() [2/2]
Share directly to SMS with custom config.
- Parameters
-
◆ ShareToMessenger() [1/2]
void Megacool.ShareToMessenger |
( |
| ) |
|
|
inline |
Share directly to Facebook Messenger.
- Parameters
-
◆ ShareToMessenger() [2/2]
Share directly to Facebook Messenger with custom config.
- Parameters
-
◆ ShareToTwitter() [1/2]
void Megacool.ShareToTwitter |
( |
| ) |
|
|
inline |
Share directly to Twitter.
- Parameters
-
◆ ShareToTwitter() [2/2]
Share directly to Twitter with custom config.
- Parameters
-
◆ Start()
Initialize the SDK.
To listen for events for the SDK, make sure you register the delegates for OnLinkClicked/OnReceivedShareOpened and similar before calling this.
◆ StartRecording() [1/2]
void Megacool.StartRecording |
( |
| ) |
|
|
inline |
Start recording a GIF
This will keep a buffer of 50 frames (default). The frames are overwritten until StopRecording
gets called.
◆ StartRecording() [2/2]
Start customized GIF recording.
This will keep a buffer of 50 frames (default). The frames are overwritten until StopRecording
gets called.
- Parameters
-
config | Config to customize the recording. |
◆ StopRecording()
void Megacool.StopRecording |
( |
| ) |
|
|
inline |
Stops the recording. Calling CaptureFrame or StartRecording after this will cause a new recording to be started.
If KeepCompletedRecordings is set to true (default is false), the recording will still be available on disk and can be shared and/or previewed later, and you have to manually call DeleteRecording when you want to clear it from disk. With the default setting it'll be deleted automatically when a new recording is started.
◆ SubmitDebugData()
void Megacool.SubmitDebugData |
( |
string |
message | ) |
|
|
inline |
Submit debug data from the SDK to the developers to assist in fixing bugs.
If something in the SDK is not behaving as expected, set Debug=true as early as possible (preferably before Start()), after the problem has been observed call this method with a descriptive message. The developers will then receive logs and other debugging information from the device to assist in debugging.
- Parameters
-
message | Brief summary of what you expected to happen and what happened |
◆ CompletedSharing
Action Megacool.CompletedSharing |
Initial value:
Callback when a user has completed a share. On Android this is only available for API level 22+.
Megacool.Instance.CompletedSharing += () => { Debug.Log("User completed sharing"); }
◆ DismissedSharing
Action Megacool.DismissedSharing |
Initial value:
Callback when a user has aborted (dismissed) a share. On Android this is only available for API level 22+.
Megacool.Instance.DismissedSharing += () => { Debug.Log("User dismissed sharing"); }
◆ OnLinkClicked
Listen to link click events. This is what you should use for navigation within your app if you implement deep linking.
This event does not rely on network connectivity and is thus very fast and always available, but that also means the data will not necessarily be valid. Use the url in the event for navigation, but wait for the MegacoolReceivedShareOpened event if you need a verified userId or share data.
When the app is installed the first time from a referral on iOS you will not receive this event, you have to use OnReceivedShareOpened to handle that.
NB: Must be registered before calling Start() to ensure all events are received correctly.
◆ OnMegacoolEvents
Action<List<MegacoolEvent> > Megacool.OnMegacoolEvents = delegate {} |
|
static |
Listen to all events emitted by the SDK. Everything sent here will also be sent to the dedicated per-event listeners.
NB: Must be registered before calling Start() to ensure all events are received correctly.
◆ OnReceivedShareOpened
Action<MegacoolEvent> Megacool.OnReceivedShareOpened = delegate {} |
|
static |
Listen to received share opened events.
These events are emitted when this device clicks on a share sent by someone else. Use the IsFirstSession attribute on the event to determine whether the device installed the app from the share.
NB: Must be registered before calling Start() to ensure all events are received correctly.
◆ OnSentShareOpened
Listen to sent share opened events.
This is the primary event to use if you want to reward a user for generating installs, which you can tell from the IsFirstSession attribute on the event.
◆ PossiblyCompletedSharing
Action Megacool.PossiblyCompletedSharing |
Initial value:
Callback when a user either aborted or completed a share, but we can't know which.
This is only called on Android, where we cannot always tell whether the share actually completed or not.
◆ CaptureMethod
MegacoolCaptureMethod Megacool.CaptureMethod |
|
getset |
Set how frames should be captured.
The capture method.
◆ Debug
Turn on / off debug mode. In debug mode calls to the SDK are stored and can be submitted to the core developers using SubmitDebugData later.
true
if debug mode; otherwise, false
.
◆ FrameRate
Set number of frames per second to record.
Default is 10 frames / second. The GIF will be recorded with this frame rate.
The frame rate.
◆ GifColorTable
Set the type of GIF color table to use. Default is fixed 256 colors.
It's recommended to test all to see which gives the best result. It depends on the color usage in the app.
The gif color table type
◆ Instance
Gets the instance.
The instance.
◆ KeepCompletedRecordings
bool Megacool.KeepCompletedRecordings |
|
set |
Whether to keep completed recordings around.
The default is false, which means that all completed recordings will be deleted whenever a new recording is started with either captureFrame
or startRecording
. Setting this to true
means we will never delete a completed recording, which is what you want if you want to enable player to browse previous GIFs they've created. A completed recording will still be overwritten if a new recording is started with the same recordingId
.
true
to keep completed recordings; otherwise, false
.
◆ LastFrameDelay
int Megacool.LastFrameDelay |
|
getset |
Set a delay (in milliseconds) on the last frame in the animation.
Default is 1000 milliseconds
The last frame delay.
◆ LastFrameOverlay
string Megacool.LastFrameOverlay |
|
set |
Overlay an image over the last frame of the GIF.
Default is none. The path should be relative to the StreamingAssets directory.
To show the overlay on previews as well you need to set includeLastFrameOverlay=true on the PreviewConfig.
The path to the last frame overlay, relative to the StreamingAssets directory
◆ MaxFrames
Max number of frames on the buffer.
Default is 50 frames.
Max frames.
◆ PeakLocation
double Megacool.PeakLocation |
|
getset |
Location in recording where max number of points should occur
Default is 0.7 (70% of the way through the recording)
Peak location.
◆ PlaybackFrameRate
float Megacool.PlaybackFrameRate |
|
getset |
Set playback speed in number of frames per second.
Default is 12 frames / second. The GIF will be exported with this frame rate.
The playback frame rate.
◆ SharingStrategy
MegacoolSharingStrategy Megacool.SharingStrategy |
|
set |
Set whether to prioritize GIFs or link when sharing to channels that support either but not both.
The sharing strategy to use
◆ SharingText
string Megacool.SharingText |
|
getset |
Set the text to be shared of different channels.
The text should be set before Share() is called.
The sharing text.
The documentation for this class was generated from the following file: