Hi.
I am trying to implement my own procedual avatar system into ORK3.
Here is Textire2D FooClass.GetTexture2D(Combatant combatant) .
(ex. Warrior A and Warrior B has different Face Portrait Texure)

And I want to Display these Portrait texture in Combatant Infomation HUD just like combatant Icon.
There is some way to display em.1st I tried to change icon properties on combatants.
but icon is depends on TMP. so It seems hard to change that.

Is there a good solution for display em into HUD?
  • How do you connect those textures to the combatant? Based on that, you could just write a custom HUD component to show it.

    ORK also has a built-in system (portrait sets for your combatants) to allow switching between them.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I wrote simple monobehavor just like that

    public class CustomPortrait : MonoBehaviour
    {
    public HUDContentProviderComponent provider;

    void Start()
    {
    Combatant combatant = ORKComponentHelper.ToCombatant(this.provider.User);
    Image img = GetComponent<Image>();
    Texture2D tex = FooClass.GetTexture2D(combatant) ;
    img.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), Vector2.zero);
    }
    }


    Best way is creating custum HUD components. but it works enough for me.
    Is it wrong?

    convatant has string variable which contains Base64 encoded texture image.
    FooClass decodes that Base64 string to texture image.
  • Should work like that - probably change it from Start to OnEnable to have it run each time it's enabled.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.