あなたの世界を作りなさい
記録
スクリーンショット
13 分
スクリーンショット機能の使用 zepetoworldcontent apiの画像関連機能を使用して、ワールド内で画像を保存または共有し、フィードに画像を投稿できます。 zepetoworldcontent apiは、以下の画像関連機能を提供します。 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type 以下は、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, "\[コンテンツ]", (result boolean) => {console log(`フィード作成結果 ${result}`)}); zepetoworldcontent createfeed(this texture2d, "\[コンテンツ]", (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, "\[コンテンツ]", (result boolean) => { this logtext text = `フィード作成結果 ${result}`; }); }); } } unityエディタモードではチェックできませんが、アプリでプレイしているときにチェックできます。 スクリーンショット スクリーンショットモジュールはbuild it unity plug inに含まれており、下記のgithubでモジュールスクリプトを確認することができます。 📘 build it unity plug inスクリーンショット·モジュール https //github com/zepeto techevangelist/zepeto buildit template/tree/main/assets/buildittemplate/modules/screenshot スクリーンショット機能の使用方法 スクリーンショット機能は、build it unity plug in ワールドプレイ画面の右側に位置するカメラアイコンをクリックして使用することができます。 1:セルフィーモードボタン カメラをセルフィーモードに切り替えることができます。 2:写真撮影ボタン プレイ画面を撮影できます。 3:動画録画ボタン プレイ画面を録画できます。 4:出るボタン スクリーンショットモードから出ることができます。 ✏️ ノート チャットの吹き出しは撮影できませんので、ご参考ください。 写真撮影 写真撮影ボタンを押すと、上記のポップアップウィンドウが表示されます。 upload ボタンを押すと、撮影された写真が私のzepetoフィードにすぐアップロードされます。 写真はスクリーンショットprefabに設定された基本descriptionテキストとともにフィードにアップロードされます。 基本テキストを変更する方法は docid 6 bunlvcmsajjfj6kkvhw ガイドをご参照ください。 edit ボタンを押すと、スクリーンショットをフィードにアップロードする前に投稿テキストを修正することができます。 1 共有ボタン スクリーンショットを共有できます。 2 ダウンロードボタン スクリーンショットを自分のデバイスに保存できます。 3 出るボタン editモードに出ることができます。 4 写真プレビューウィンドウ 撮影されたスクリーンショットをプレビューできます。 5 ポストテキスト修正 スクリーンショットとともに、zepetoフィードにアップロードされるテキストを修正できます。 6 アップロードボタン スクリーンショットとテキストをzepetoフィードにアップロードできます。 動画録画 動画録画ボタンを押すと録画が始まり、録画時間がディスプレイされます。 セルフィーモード スクリーンショットアイコンをタップすると、セルフィーモードのアイコンが表示されます。 アイコンをタップすると、セルフィーモードを使用できます。 セルフィーモードでは、キャラクターがカメラの方向を見ます。カメラが一定の角度以上に動くと、キャラクターは再び正面を向きます。 セルフィーモードが有効な状態で写真を撮ったり、動画を録画したりできます。 セルフィーモードアイコンをもう一度タップするとモードを終了でき、スクリーンショット機能を終了するとセルフィーモードも終了します。 スクリーンショット 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 ウィンドウで左側のチェックボックスをチェックします。
