Page 1 of 1

Avatar from internet

Posted: Sun Oct 29, 2023 6:07 pm
by angelothic
Hello,

I want to change player avatar with downloaded image.
Can anyone please share me how to change avatar to player (#1 id)?


Thank you.

Re: Avatar from internet

Posted: Sun Oct 29, 2023 7:55 pm
by Tony Li
Hi,

There are two or three steps:

1. Download the image from the Internet as a texture. See Retrieving a Texture from an HTTP Server (GET)

2. Convert the texture to a sprite. Example:

Code: Select all

Sprite sprite = PixelCrushers.DialogueSystemUITools.CreateSprite(yourDownloadedTexture2D);
3. Assign the sprite to the actor. Example:

Code: Select all

DialogueManager.masterDatabase.GetActor("Player").spritePortrait = sprite;

Re: Avatar from internet

Posted: Sun Oct 29, 2023 8:18 pm
by angelothic
Thank you very much dude. Hope one day you open discord server.
Have nice week..

Re: Avatar from internet

Posted: Sun Oct 29, 2023 8:23 pm
by Tony Li
There's a link to the Discord server in the Dialogue System's _README.txt file.

Discord is good for discussion, but forums are better for questions because it's easier to search for previously-answered questions. Also, here on the forum you can search for "HOWTO" plus a question to get useful how-to articles.