CREATE YOUR WORLD
Recording
ScreenShot
14min
스크린샷 기능 사용하기 zepetoworldcontent api의 이미지 관련 기능을 사용하여 월드 내에서 이미지를 저장하거나 공유하고, 피드에 이미지를 게시할 수 있습니다 zepetoworldcontent api는 다음과 같은 이미지 관련 기능을 제공합니다 api 설명 zepetoworldcontent savetocameraroll(rt unityengine rendertexture, result system action$1) 이미지를 사진 라이브러리에 저장합니다 zepetoworldcontent savetocameraroll(texture unityengine texture2d, result system action$1) 이미지를 사진 라이브러리에 저장합니다 zepetoworldcontent share(rt unityengine rendertexture, result system action$1) 이미지를 외부 앱에 공유합니다 zepetoworldcontent share(texture unityengine texture2d, result system action$1) 이미지를 외부 앱에 공유합니다 zepetoworldcontent createfeed(rt unityengine rendertexture, contents string, result system action$1) 이미지를 피드에 업로드합니다 게시물의 내용은 두 번째 인수인 contents를 통해 지정할 수 있습니다 월드 태그는 자동으로 적용되어 피드에 게시됩니다 zepetoworldcontent createfeed(texture unityengine texture2d, contents string, $result system action$1) 이미지를 피드에 업로드합니다 게시물의 내용은 두 번째 인수인 contents를 통해 지정할 수 있습니다 월드 태그는 자동으로 적용되어 피드에 게시됩니다 다음은 zepetoworldcontent 내에서 이미지 기능을 호출하는 예입니다 zepetoworldcontent savetocameraroll(this rendertexture, (result boolean) => {console log(`저장 결과 ${result}`)}); zepetoworldcontent savetocameraroll(this texture2d, (result boolean) => {console log(`저장 결과 ${result}`)}); zepetoworldcontent share(this rendertexture, (result boolean) => {console log(`공유 결과 ${result}`)}); zepetoworldcontent share(this texture2d, (result boolean) => {console log(`공유 결과 ${result}`)}); zepetoworldcontent createfeed(this rendertexture, "\[content]", (result boolean) => {console log(`피드 생성 결과 ${result}`)}); zepetoworldcontent createfeed(this texture2d, "\[content]", (result boolean) => {console log(`피드 생성 결과 ${result}`)}); 다음은 rendertexture를 사용하여 zepetoworldcontent의 스크린샷 모드 기능을 사용하는 예제 코드입니다 import { camera, rendertexture } from 'unityengine'; import { button, text } from 'unityengine ui'; import { spawninfo, zepetoplayers } from 'zepeto character controller'; import { zepetoscriptbehaviour } from 'zepeto script'; import { worldservice, zepetoworldcontent } from 'zepeto world'; export default class zepetoworldcontentexample extends zepetoscriptbehaviour { // zepetoworldcontent 스크린샷 ui public camerarenderbutton button; public savetocamerarollbutton button; public sharebutton button; public createfeedbutton button; public logtext text; // 렌더 카메라 private camera camera; // 렌더 텍스처 public rendertexture rendertexture; start() { zepetoplayers instance createplayerwithuserid(worldservice userid, new spawninfo(), true); zepetoplayers instance onaddedlocalplayer addlistener(() => { this camera = zepetoplayers instance localplayer zepetocamera camera; }); this camerarenderbutton onclick addlistener(() => { this camera targettexture = this rendertexture; this camera render(); this camera targettexture = null; }); this savetocamerarollbutton onclick addlistener(() => { zepetoworldcontent savetocameraroll(this rendertexture, (result boolean) => { this logtext text = `저장 결과 ${result}`; }); }); this sharebutton onclick addlistener(() => { zepetoworldcontent share(this rendertexture, (result boolean) => { this logtext text = `공유 결과 ${result}`; }); }); this createfeedbutton onclick addlistener(() => { zepetoworldcontent createfeed(this rendertexture, "\[content]", (result boolean) => { this logtext text = `피드 생성 결과 ${result}`; }); }); } } 유니티 에디터 모드에서는 확인할 수 없지만, 앱에서 플레이할 때 확인할 수 있습니다 스크린샷 스크린샷 모듈은 빌드잇 유니티 플러그인에 포함되어 있으며, 아래 github에서 모듈 스크립트를 확인할 수 있습니다 📘 빌드잇 유니티 플러그인 스크린샷 모듈 github 링크 스크린샷 기능 사용 방법 스크린샷 기능은 빌드잇 유니티 플러그인 월드 플레이 화면의 우측에 위치한 카메라 아이콘을 눌러 사용할 수 있습니다 1 셀카 모드 버튼 카메라를 셀카 모드로 전환할 수 있습니다 2 사진 촬영 버튼 플레이 화면을 촬영할 수 있습니다 3 동영상 녹화 버튼 플레이 화면을 녹화할 수 있습니다 4 나가기 버튼 스크린샷 모드를 나갈 수 있습니다 ✏️ 노트 채팅 말풍선은 촬영되지 않으니 참고하여 주세요 사진 촬영 사진 촬영 버튼을 누르면 위와 같은 팝업 창이 나타납니다 upload 버튼을 누르면 촬영된 사진이 내 제페토 피드에 바로 업로드 됩니다 사진은 스크린샷 prefab에 설정된 기본 description 텍스트와 함께 피드에 업로드 됩니다 기본 텍스트를 변경하는 방법은 screenshot docid 5kjbaxcklgmx4crjai6ea 을 참고해주세요 edit 버튼을 누르면 스크린샷을 피드에 업로드하기 전에 게시물 텍스트를 수정할 수 있습니다 1 공유 버튼 스크린샷을 공유할 수 있습니다 2 다운로드 버튼 스크린샷을 내 기기에 저장할 수 있습니다 3 나가기 버튼 edit 모드를 나갈 수 있습니다 4 사진 미리보기 창 촬영된 스크린샷을 미리 볼 수 있습니다 5 포스트 텍스트 수정 스크린샷과 함께 제페토 피드에 업로드 될 텍스트를 수정할 수 있습니다 6 업로드 버튼 스크린샷과 텍스트를 제페토 피드에 업로드 할 수 있습니다 동영상 녹화 동영상 녹화 버튼을 누르면 녹화가 시작되며, 녹화 시간이 디스플레이 됩니다 셀카 모드 스크린샷 아이콘을 누르면 셀카 모드 아이콘이 나타납니다 아이콘을 누르면 셀카 모드를 사용할 수 있습니다 셀카 모드에선 캐릭터가 카메라를 바라봅니다 카메라가 일정 각도 이상으로 움직이면 캐릭터는 다시 정면을 바라봅니다 셀카 모드를 활성화한 상태로 사진을 촬영하거나 동영상을 녹화할 수 있습니다 셀카 모드 아이콘을 다시 한 번 누르면 셀카 모드를 종료할 수 있으며, 스크린샷 기능을 종료하면 셀카 모드 또한 종료됩니다 스크린샷 description 텍스트 변경 방법 팝업 창의 upload 버튼을 통해 게시물을 업로드하면 스크린샷은 기본 텍스트인 '#zepetoworld #zepeto #bildy #world' 와 함께 업로드됩니다 edit 버튼을 눌렀을 때 나오는 description 박스에 있는 텍스트 또한 기본 텍스트인 '#zepetoworld #zepeto #bildy #world' 입니다 기본 description 텍스트를 변경하는 방법은 다음과 같습니다 왼쪽 hierarchy 창에서 managers > screenshot 을 선택합니다 오른쪽 inspector 창에서 prefab 영역 밑에 있는 open 버튼을 눌러 screenshot prefab을 엽니다 왼쪽 hierarchy 창에서 screenshot > safearea > screenshot > previewpanel > previewtextfieldpanel > previewinputfield 를 선택합니다 오른쪽 inspector 창에서 text 필드를 찾아 원하는 텍스트로 변경합니다 아래 예시와 같이 텍스트를 변경하면 description 박스의 텍스트가 변경된 것을 확인할 수 있습니다 스크린샷 아이콘이 보이지 않을 때 위와 같이 플레이 화면 오른쪽에 스크린샷 아이콘이 보이지 않을 때 해결 방법은 다음과 같습니다 왼쪽 hierarchy 창에서 managers > screenshot 을 선택합니다 오른쪽 inspector 창에서 왼쪽 체크박스를 체크합니다