Class Sharing
Inheritance
Namespace: EasyMobile
Assembly: cs.temp.dll.dll
Syntax
public static class Sharing
Methods
CaptureScreenshot()
Captures a full-screen screenshot and returns the generated Texture2D object. Note that this method should be called at the end of the frame (called within a coroutine after WaitForEndOfFrame())
Declaration
public static Texture2D CaptureScreenshot()
Returns
Type | Description |
---|---|
Texture2D | The full-screen screenshot. |
CaptureScreenshot(Single, Single, Single, Single)
Captures the specified area of the screen and returns the generated Texture2D object. Note that this method should be called at the end of the frame (called within a coroutine after WaitForEndOfFrame())
Declaration
public static Texture2D CaptureScreenshot(float startX, float startY, float width, float height)
Parameters
Type | Name | Description |
---|---|---|
System. |
startX | Start x. |
System. |
startY | Start y. |
System. |
width | Width. |
System. |
height | Height. |
Returns
Type | Description |
---|---|
Texture2D | The screenshot. |
SaveScreenshot(Single, Single, Single, Single, String)
Captures the specified area of the screen and saves the screenshot as a PNG image with the given filename.. The created file is saved to the persistentDataPath if running on mobile devices, or to Assets folder if running in the editor. Note that this method should be called at the end of the frame (called within a coroutine after WaitForEndOfFrame())
Declaration
public static string SaveScreenshot(float startX, float startY, float width, float height, string filename)
Parameters
Type | Name | Description |
---|---|---|
System. |
startX | Start x. |
System. |
startY | Start y. |
System. |
width | Width. |
System. |
height | Height. |
System. |
filename | Filename to store the resulted PNG image without the file extension. |
Returns
Type | Description |
---|---|
System. |
The filepath to the saved screenshot. |
SaveScreenshot(String)
Captures the whole screen and saves the screenshot as a PNG image with the given filename. The created file is saved to the persistentDataPath if running on mobile devices, or to Assets folder if running in the editor. Note that this method should be called at the end of the frame (called within a coroutine after WaitForEndOfFrame())
Declaration
public static string SaveScreenshot(string filename)
Parameters
Type | Name | Description |
---|---|---|
System. |
filename | Filename to store the resulted PNG image without the file extension. |
Returns
Type | Description |
---|---|
System. |
The filepath to the saved screenshot. |
ShareImage(String, String, String)
Shares the image at the given path via native sharing utility.
Declaration
public static void ShareImage(string imagePath, string message, string subject = "")
Parameters
Type | Name | Description |
---|---|---|
System. |
imagePath | Image path. |
System. |
message | Message. |
System. |
subject | Subject. |
ShareScreenshot(Single, Single, Single, Single, String, String, String)
Captures the specified area of the screen, saves it as a PNG image and then shares it to social networks via the native sharing utility. The parameters specify the area of the screen are in pixels (screen space). Note that this method should be called at the end of the frame (called within a coroutine after WaitForEndOfFrame())
Declaration
public static string ShareScreenshot(float startX, float startY, float width, float height, string filename, string message, string subject = "")
Parameters
Type | Name | Description |
---|---|---|
System. |
startX | Start x. |
System. |
startY | Start y. |
System. |
width | Width. |
System. |
height | Height. |
System. |
filename | Filename to store the resulted PNG image without the file extension. |
System. |
message | Message. |
System. |
subject | Subject. |
Returns
Type | Description |
---|---|
System. |
The filepath to the saved screenshot. |
ShareScreenshot(String, String, String)
Captures the screenshot, saves it as a PNG image and then shares it to social networks via the native sharing utility. Note that this method should be called at the end of the frame (called within a coroutine after WaitForEndOfFrame())
Declaration
public static string ShareScreenshot(string filename, string message, string subject = "")
Parameters
Type | Name | Description |
---|---|---|
System. |
filename | Filename to store the resulted PNG image without the file extension. |
System. |
message | Message. |
System. |
subject | Subject. |
Returns
Type | Description |
---|---|
System. |
The filepath to the saved screenshot. |
ShareText(String, String)
Shares a text using the native sharing utility. Note that Facebook doesn't allow pre-filled sharing message, so the text will be discarded when sharing to that particular network.
Declaration
public static void ShareText(string text, string subject = "")
Parameters
Type | Name | Description |
---|---|---|
System. |
text | Text. |
System. |
subject | Subject. |
ShareTexture2D(Texture2D, String, String, String)
Generates a PNG image from the given Texture2D object, saves it to persistentDataPath using the given filename and then shares the image via the native sharing utility.
Declaration
public static string ShareTexture2D(Texture2D tt, string filename, string message, string subject = "")
Parameters
Type | Name | Description |
---|---|---|
Texture2D | tt | Tt. |
System. |
filename | Filename to store the resulted PNG image without the file extension. |
System. |
message | Message. |
System. |
subject | Subject. |
Returns
Type | Description |
---|---|
System. |
The filepath to the saved image. |
ShareURL(String, String)
Shares a URL using the native sharing utility.
Declaration
public static void ShareURL(string url, string subject = "")
Parameters
Type | Name | Description |
---|---|---|
System. |
url | URL. |
System. |
subject | Subject. |