CREATE YOUR WORLD
Social
User Information
4min
searching user information user information can be searched using the zepetoworldhelper getuserinfo function the callback function included in the userid such as the time of completion, time of error occurrence, and string array is passed as an argument the following is an example of calling the zepetoworldhelper getuserinfo function zepetoworldhelper getuserinfo(ids, (info users\[]) => { for (let i = 0; i < info length; i++) { console log(`userid ${info\[i] useroid}, name ${info\[i] name}, zepetoid ${info\[i] zepetoid}`); } }, (error) => { console log(error); }); the following is a full example code for searching user information please change "userid 1","userid 2" values to real userid values when using the example code import { zepetoscriptbehaviour } from 'zepeto script'; import { zepetoworldhelper, users } from 'zepeto world'; export default class userinfo extends zepetoscriptbehaviour { start() { let ids string\[] = \["userid 1", "userid 2"]; zepetoworldhelper getuserinfo(ids, (info users\[]) => { for (let i = 0; i < info length; i++) { console log(`userid ${info\[i] useroid}, name ${info\[i] name}, zepetoid ${info\[i] zepetoid}`); } }, (error) => { console log(error); }); } } importing user profile image use the zepetoworldhelper getprofiletexture function to load a user's profile photo the callback function from the time of completion to time of error occurrence and userid is passed as an argument the following is an example code for calling the zepetoworldhelper getprofiletexture function zepetoworldhelper getprofiletexture(this userid, (texture texture) => { this sampleimage sprite = this getsprite(texture); }, (error) => { console log(error); }); the following is an example code that imports a user's profile photo import { zepetoscriptbehaviour } from 'zepeto script'; import { zepetoworldhelper } from 'zepeto world'; import { texture,texture2d, sprite, rect, vector2 } from 'unityengine'; import { image } from 'unityengine ui'; export default class gettextureexample extends zepetoscriptbehaviour { public userid string; public sampleimage image; start() { zepetoworldhelper getprofiletexture(this userid, (texture texture) => { this sampleimage sprite = this getsprite(texture); }, (error) => { console log(error); }); } getsprite(texture texture) { let rect rect = new rect(0, 0, texture width, texture height); return sprite create(texture as texture2d, rect, new vector2(0 5, 0 5)); } }