How to get your actor's portrait in code
Posted: Wed Oct 31, 2018 3:52 pm
Just wondering how do I obtain the actor's portrait within the code and also understand how to utilize the files[] type.
Support and discussion forum for Pixel Crushers products
https://www.pixelcrushers.com:443/phpbb/
https://www.pixelcrushers.com:443/phpbb/viewtopic.php?t=1773
Code: Select all
Actor actor = DialogueManager.masterDatabase.GetActor("Player");
Texture2D primaryPortraitTexture = actor.GetPortraitTexture(1);
Sprite primaryPortraitSprite = UITools.CreateSprite(primaryPortraitTexture);
Code: Select all
Texture2D currentSpeakerPortrait = DialogueManager.currentConversationState.subtitle.speakerInfo.portrait;
Code: Select all
actor.CreateSprite(primaryPortraitTexture); // (incorrect)
Code: Select all
UITools.CreateSprite(primaryPortraitTexture); // (correct)