ScreenShot
You can use the image related functions of ZepetoWorldContent API to save or share images within the World, and post images to feed.
ZepetoWorldContent API provides the following image related functions.
API | Description |
---|---|
ZepetoWorldContent.SaveToCameraRoll(rt: UnityEngine.RenderTexture, result: System.Action$1) | Saves the image to the photo library. |
ZepetoWorldContent.SaveToCameraRoll(texture: UnityEngine.Texture2D, result: System.Action$1) | Saves the image to the photo library. |
ZepetoWorldContent.Share(rt: UnityEngine.RenderTexture, result: System.Action$1) | Shares the image to an external app. |
ZepetoWorldContent.Share(texture: UnityEngine.Texture2D, result: System.Action$1) | Shares the image to an external app. |
ZepetoWorldContent.CreateFeed(rt: UnityEngine.RenderTexture, contents: string, result: System.Action$1) | Uploads the image to feed. The content of the post can be specified through the second argument, contents. World tags are automatically applied and posted to the feed. |
ZepetoWorldContent.CreateFeed(texture: UnityEngine.Texture2D, contents: string, $result: System.Action$1) | Uploads the image to feed. The content of the post can be specified through the second argument, contents. World tags are automatically applied and posted to the feed. |
The following is an example of calling the image functions within the ZepetoWorldContent.
The following is the example code using the functions of the screenshot mode in ZepetoWorldContent using RenderTexture.
- It cannot be checked in the Unity editor mode, but can be checked when playing on the app.
The example project is available for download from Github.
📘 Official ScreenShot Sample
👍 Screenshot Sample Description
- This is a ScreenShot example project using image-related functions of the ZepetoWorldContent API.
- ZEPETO login must be proceeded before you can run the project.
- It consists of selfie mode and ZepetoCamera mode, saving or sharing images via RenderTexture, and using images to create feeds.
When applying to existing projects, we recommend that you follow the guidelines below.
- Zepeto.World version must be 1.21.14 or higher.
- You can use ZepetoWorldContent function normally when proceeded within 1.21.14 or higher versions of the World. Version update available at Window - PackageManager - Zepeto.World
- Layer 21 in the sample project is designated as Player.
- If you are using custom layer 21 when applying to an existing project, please modify the value of playerLayer in ZepetoScreenShotModule.ts.
- ZepetoPlayers must be in Scene.
- Player generation code must be written separately.
- Please refer to the PlayerCreator.ts file in the project.
- You must insert ZepetoScreenShotModule into Scene.
- Animator that IKPass activated must be used.
👍 IKPass
- When using an existing ZepetoAnimator
- Drag the ZepetoAnimator file from ZepetoPlayers to the Assets/... path in the local environment and copy the corresponding asset.
- Activate the IKPass of the copied ZepetoAnimator, and replace the Animator Controller of the ZepetoPlayers with the corresponding animator.
- When using Custom Animator
- Activate the IKPass of the currently used Animator.
- The rotation direction is supported based on the Horizontal.
- Set as Orientation - Horizontal in ZepetoWorldSetting.
- Regarding camera settings
- Camera settings in ZepetoCamera mode modify the settings of ZepetoPlayers - Camera.
- The camera settings in selfie camera mode change the setting values of Selfie Camera.ts in Resources - Selfie Camera prefab.